Do not assign the variable in the condition.
authorPlatonides <platonides@users.mediawiki.org>
Sat, 6 Nov 2010 00:18:30 +0000 (00:18 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sat, 6 Nov 2010 00:18:30 +0000 (00:18 +0000)
Use transform() instead of the deprecated getThumbnail()

includes/specials/SpecialUploadStash.php

index e28203a..64e59b6 100644 (file)
@@ -113,8 +113,8 @@ class SpecialUploadStash extends SpecialPage {
                        // ok we're here so the original must exist. Generate the thumbnail. 
                        // because the file is a UploadStashFile, this thumbnail will also be stashed,
                        // and a thumbnailFile will be created in the thumbnailImage composite object
-                       $thumbnailImage = null;
-                       if ( !( $thumbnailImage = $origFile->getThumbnail( $width ) ) ) { 
+                       $thumbnailImage = $origFile->transform( array( 'width' => $width ) );
+                       if ( !$thumbnailImage ) { 
                                throw new MWException( 'Could not obtain thumbnail' );
                        }
                        $file = $thumbnailImage->thumbnailFile;