diff options
| author | modela bitweaver <spiderr@bitweaver.org> | 2021-02-02 16:18:16 -0500 |
|---|---|---|
| committer | modela bitweaver <spiderr@bitweaver.org> | 2021-02-02 16:18:16 -0500 |
| commit | 182207fc4beb9c4149e79b725bf7db85dfa77c3d (patch) | |
| tree | 8f558328d4f5aae607189268781b50eb62b3d999 | |
| parent | c537ffcc87d8dc1be6380eb5f6c5a221831210a6 (diff) | |
| download | liberty-182207fc4beb9c4149e79b725bf7db85dfa77c3d.tar.gz liberty-182207fc4beb9c4149e79b725bf7db85dfa77c3d.tar.bz2 liberty-182207fc4beb9c4149e79b725bf7db85dfa77c3d.zip | |
PHP7 ::getAttachment static only
| -rw-r--r-- | includes/classes/LibertyMime.php | 10 | ||||
| -rw-r--r-- | includes/edit_storage_inc.php | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/includes/classes/LibertyMime.php b/includes/classes/LibertyMime.php index 17c7f54..94d019c 100644 --- a/includes/classes/LibertyMime.php +++ b/includes/classes/LibertyMime.php @@ -629,7 +629,7 @@ class LibertyMime extends LibertyContent { * @access public * @return attachment details */ - public function getAttachment( $pAttachmentId, $pParams = NULL ) { + public static function getAttachment( $pAttachmentId, $pParams = NULL ) { global $gLibertySystem, $gBitSystem; $ret = NULL; @@ -638,13 +638,7 @@ class LibertyMime extends LibertyContent { if( $result = $gBitSystem->mDb->query( $query, array( (int)$pAttachmentId ))) { if( $row = $result->fetchRow() ) { if( $func = $gLibertySystem->getPluginFunction( $row['attachment_plugin_guid'], 'load_function', 'mime' )) { - $prefs = array(); - // if the object is available, we'll copy the preferences by reference to allow the plugin to update them as needed - if( !empty( $this ) && !empty( $this->mStoragePrefs[$pAttachmentId] )) { - $prefs = &$this->mStoragePrefs[$pAttachmentId]; - } else { - $prefs = static::getAttachmentPreferences( $pAttachmentId ); - } + $prefs = static::getAttachmentPreferences( $pAttachmentId ); $ret = $func( $row, $prefs, $pParams ); } } diff --git a/includes/edit_storage_inc.php b/includes/edit_storage_inc.php index 3d40b0f..bba99ad 100644 --- a/includes/edit_storage_inc.php +++ b/includes/edit_storage_inc.php @@ -35,7 +35,7 @@ if( !empty( $_REQUEST['deleteAttachment'] )) { } $attachmentId = $_REQUEST['deleteAttachment']; - $attachmentInfo = $gContent->getAttachment( $attachmentId ); + $attachmentInfo = LibertyMime::getAttachment( $attachmentId ); // the second part of this check seems odd (never used?) to me, but I'll leave it in for now - spiderr 10/17/2007 if( $gContent->hasAdminPermission() || ( $gContent->isOwner( $attachmentInfo ) && $gBitUser->hasPermission( 'p_liberty_delete_attachment' ))) { |
