Fix regression from r81558: fatal error in ForeignFileRepo thumb fetching when thumb...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 6 Apr 2011 18:27:20 +0000 (18:27 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 6 Apr 2011 18:27:20 +0000 (18:27 +0000)
Addition of optional parameters lead to passing default 'null' straight through on a reference parameter, which PHP 5.3 really disapproves of. Sticking in a temp variable resolves this easily.

includes/filerepo/ForeignAPIRepo.php

index 35a0ffd..55b1be3 100644 (file)
@@ -231,7 +231,8 @@ class ForeignAPIRepo extends FileRepo {
                global $wgMemc;
 
                if ( !$this->canCacheThumbs() ) {
-                       return $this->getThumbUrl( $name, $width, $height, null, $params );
+                       $result = null; // can't pass "null" by reference, but it's ok as default value
+                       return $this->getThumbUrl( $name, $width, $height, $result, $params );
                }
                $key = $this->getLocalCacheKey( 'ForeignAPIRepo', 'ThumbUrl', $name );
                $sizekey = "$width:$height:$params";