Followup to r44204. Hardcoding image because it should (in theory) work always and...
[lhc/web/wiklou.git] / includes / filerepo / File.php
index 5b9a71e..4969647 100644 (file)
@@ -506,8 +506,7 @@ abstract class File {
         *
         * @param integer $width        maximum width of the generated thumbnail
         * @param integer $height       maximum height of the image (optional)
-        * @param boolean $render       True to render the thumbnail if it doesn't exist,
-        *                              false to just return the URL
+        * @param boolean $render       Deprecated
         *
         * @return ThumbnailImage or null on failure
         *
@@ -518,8 +517,7 @@ abstract class File {
                if ( $height != -1 ) {
                        $params['height'] = $height;
                }
-               $flags = $render ? self::RENDER_NOW : 0;
-               return $this->transform( $params, $flags );
+               return $this->transform( $params, 0 );
        }
 
        /**
@@ -582,7 +580,7 @@ abstract class File {
                        // Purge. Useful in the event of Core -> Squid connection failure or squid 
                        // purge collisions from elsewhere during failure. Don't keep triggering for 
                        // "thumbs" which have the main image URL though (bug 13776)
-                       if ( $wgUseSquid && ($thumb->isError() || $thumb->getUrl() != $this->getURL()) ) {
+                       if ( $wgUseSquid && ( !$thumb || $thumb->isError() || $thumb->getUrl() != $this->getURL()) ) {
                                SquidUpdate::purge( array( $thumbUrl ) );
                        }
                } while (false);
@@ -1248,7 +1246,7 @@ abstract class File {
        function getRedirectedTitle() {
                if ( $this->redirected ) {
                        if ( !$this->redirectTitle )
-                               $this->redirectTitle = Title::makeTitle( NS_IMAGE, $this->redirected );
+                               $this->redirectTitle = Title::makeTitle( NS_FILE, $this->redirected );
                        return $this->redirectTitle;
                }
        }