diff options
| author | spiderr <spiderr@bitweaver.org> | 2021-01-15 13:00:23 -0500 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2021-01-15 13:00:23 -0500 |
| commit | 54cec84b40ce53d5755c507e9ca696fadb1ca80d (patch) | |
| tree | e06015f60dd7c6016111d7963d3e9887be636f9d | |
| parent | b6519dc69db7239970c62891d1f473b4e0daf1df (diff) | |
| download | fisheye-54cec84b40ce53d5755c507e9ca696fadb1ca80d.tar.gz fisheye-54cec84b40ce53d5755c507e9ca696fadb1ca80d.tar.bz2 fisheye-54cec84b40ce53d5755c507e9ca696fadb1ca80d.zip | |
tweak liberty_get_function logic and check returned value
| -rw-r--r-- | FisheyeImage.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/FisheyeImage.php b/FisheyeImage.php index 9f8fb40..d780ed3 100644 --- a/FisheyeImage.php +++ b/FisheyeImage.php @@ -396,8 +396,8 @@ class FisheyeImage extends FisheyeBase { } if( is_numeric( $pDegrees ) ) { $fileHash['degrees'] = $pDegrees; - $rotateFunc = liberty_get_function( 'rotate' ); - if( $rotateFunc( $fileHash ) ) { + + if( ($rotateFunc = liberty_get_function( 'rotate' )) && $rotateFunc( $fileHash ) ) { liberty_clear_thumbnails( $fileHash ); $this->mDb->query( "UPDATE `".BIT_DB_PREFIX."fisheye_image` SET `width`=`height`, `height`=`width` WHERE `content_id`=?", array( $this->mContentId ) ); $this->clearFromCache(); @@ -455,9 +455,7 @@ class FisheyeImage extends FisheyeBase { $fileHash['max_height'] = $fileHash['max_width'] = $pResizeOriginal; // make a copy of the fileHash that we can compare output after processing $preResize = $fileHash; - $resizeFunc = liberty_get_function( 'resize' ); - - if( $resizeFile = $resizeFunc( $fileHash ) ) { + if( ($resizeFunc = liberty_get_function( 'resize' )) && ($resizeFile = $resizeFunc( $fileHash )) ) { clearstatcache(); // Ack this is evil direct bashing of the liberty tables! XOXO spiderr // should be a cleaner way eventually |
