From 37b73a88820fda845e73f6a03f7406bad1e1d3b6 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Sat, 30 Oct 2004 07:29:33 +0000 Subject: [PATCH] capitalize filename so that wikis with $wgCapitalLinks=false can access shared repositories in a case insensitive way --- includes/Image.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index 05167b7cd8..ae1653eee8 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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; -- 2.20.1