use consistent URL encoding for Image::thumbUrl() whether hashed directories are...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 20 Apr 2007 16:26:12 +0000 (16:26 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 20 Apr 2007 16:26:12 +0000 (16:26 +0000)
includes/Image.php

index c6b23ac..aefdd73 100644 (file)
@@ -772,13 +772,12 @@ class Image
                        $path = $wgUploadPath;
                }
                if ( Image::isHashed( $this->fromSharedDirectory ) ) {
-                       $url = "{$base}{$path}/thumb" .
-                       wfGetHashPath($this->name, $this->fromSharedDirectory)
-                       . $this->name.'/'.$thumbName;
-                       $url = wfUrlencode( $url );
+                       $subdir = wfGetHashPath($this->name, $this->fromSharedDirectory) .
+                       wfUrlencode( $this->name );
                } else {
-                       $url = "{$base}{$path}/thumb/{$thumbName}";
+                       $subdir = '';
                }
+               $url = "{$base}{$path}/thumb{$subdir}/" . wfUrlencode( $thumbName );
                return $url;
        }