From: Brion Vibber Date: Tue, 19 Aug 2008 18:45:32 +0000 (+0000) Subject: Revert r39608 "More descriptive sanitized paths for file repo errors" X-Git-Tag: 1.31.0-rc.0~45794 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=71c82f9a4fdf7df4172006740d728a106f7768d7;p=lhc%2Fweb%2Fwiklou.git Revert r39608 "More descriptive sanitized paths for file repo errors" 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? --- diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php index 7acc531dc7..08ec151438 100644 --- a/includes/filerepo/FSRepo.php +++ b/includes/filerepo/FSRepo.php @@ -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 ); diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index b096ce0cf0..90b198c806 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -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 ); }