Revert r39608 "More descriptive sanitized paths for file repo errors"
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 19 Aug 2008 18:45:32 +0000 (18:45 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 19 Aug 2008 18:45:32 +0000 (18:45 +0000)
This doesn't look like it'll work -- it appears to be using string interpolations in single-quoted strings?
Can you test some error conditions w/ this and show some before and after examples?

includes/filerepo/FSRepo.php
includes/filerepo/LocalRepo.php

index 7acc531..08ec151 100644 (file)
@@ -519,13 +519,13 @@ class FSRepo extends FileRepo {
                if ( !isset( $this->simpleCleanPairs ) ) {
                        global $IP;
                        $this->simpleCleanPairs = array(
-                               $this->directory => "mwrepo://{$this->name}/public",
-                               "{$this->directory}/temp" => "mwrepo://{$this->name}/temp",
+                               $this->directory => 'public',
+                               "{$this->directory}/temp" => 'temp',
                                $IP => '$IP',
                                dirname( __FILE__ ) => '$IP/extensions/WebStore',
                        );
                        if ( $this->deletedDir ) {
-                               $this->simpleCleanPairs[$this->deletedDir] = "mwrepo://{$this->name}/deleted";
+                               $this->simpleCleanPairs[$this->deletedDir] = 'deleted';
                        }
                }
                return strtr( $param, $this->simpleCleanPairs );
index b096ce0..90b198c 100644 (file)
@@ -10,21 +10,6 @@ class LocalRepo extends FSRepo {
        var $fileFromRowFactory = array( 'LocalFile', 'newFromRow' );
        var $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' );
 
-       function __construct( $info ) {
-               parent::__construct( $info );
-
-               # Initialize simpleCleanPairs, to make errors less misleading
-               global $IP;
-               $this->simpleCleanPairs = array(
-                       $this->directory => '$wgUploadDirectory',
-                       wfTempDir() => '{wfTempDir()}',
-                       $IP => '$IP',
-               );
-               if ( $this->deletedDir ) {
-                       $this->simpleCleanPairs[$this->deletedDir] = '{$wgFileStore[\'deleted\'][\'directory\']}';
-               }
-       }
-
        function getSlaveDB() {
                return wfGetDB( DB_SLAVE );
        }