Fix NS_PROJECT_TALK (bug #7792)
[lhc/web/wiklou.git] / includes / Image.php
index 5170536..1f3895c 100644 (file)
@@ -58,7 +58,7 @@ class Image
         * @param string $name name of the image, used to create a title object using Title::makeTitleSafe
         * @public
         */
-       function newFromName( $name ) {
+       public static function newFromName( $name ) {
                $title = Title::makeTitleSafe( NS_IMAGE, $name );
                if ( is_object( $title ) ) {
                        return new Image( $title );
@@ -235,7 +235,7 @@ class Image
         * Load metadata from the file itself
         */
        function loadFromFile() {
-               global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang, $wgShowEXIF;
+               global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang;
                wfProfileIn( __METHOD__ );
                $this->imagePath = $this->getFullPath();
                $this->fileExists = file_exists( $this->imagePath );
@@ -925,7 +925,7 @@ class Image
                                        if ( !$this->mustRender() && $width == $this->width && $height == $this->height ) {
                                                $url = $this->getURL();
                                        } else {
-                                               list( $isScriptUrl, $url ) = $this->thumbUrl( $width );
+                                               list( /* $isScriptUrl */, $url ) = $this->thumbUrl( $width );
                                        }
                                        $thumb = new ThumbnailImage( $url, $width, $height );
                                } else {
@@ -1360,8 +1360,9 @@ class Image
                $dir = wfImageThumbDir( $this->name, $shared );
                $urls = array();
                foreach ( $files as $file ) {
+                       $m = array();
                        if ( preg_match( '/^(\d+)px/', $file, $m ) ) {
-                               list( $isScriptUrl, $url ) = $this->thumbUrl( $m[1] );
+                               list( /* $isScriptUrl */, $url ) = $this->thumbUrl( $m[1] );
                                $urls[] = $url;
                                @unlink( "$dir/$file" );
                        }