capitalize filename so that wikis with $wgCapitalLinks=false can access
authorErik Moeller <erik@users.mediawiki.org>
Sat, 30 Oct 2004 07:29:33 +0000 (07:29 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Sat, 30 Oct 2004 07:29:33 +0000 (07:29 +0000)
shared repositories in a case insensitive way

includes/Image.php

index 05167b7..ae1653e 100644 (file)
@@ -61,13 +61,15 @@ class Image
                # If the file is not found, and a shared upload directory 
                # like the Wikimedia Commons is used, look for it there.
                if (!$this->fileExists && $wgUseSharedUploads) {
+                       # in case we're running a capitallinks=false wiki                       
+                       $sharedname=ucfirst($name);
                        
                        if($wgHashedSharedUploadDirectory) {                            
                                $hash = md5( $this->title->getDBkey() );
                                $this->imagePath = $wgSharedUploadDirectory . '/' . $hash{0} . '/' .
-                                       substr( $hash, 0, 2 ) . "/{$name}";
+                                       substr( $hash, 0, 2 ) . "/".$sharedname;
                        } else {
-                               $this->imagePath = $wgSharedUploadDirectory . '/' . $name;
+                               $this->imagePath = $wgSharedUploadDirectory . '/' . $sharedname;
                        }
                        $this->fileExists = file_exists( $this->imagePath);
                        $this->fromSharedDirectory = true;