r39652 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39651‎ | r39652 | r39653 >
Date:18:45, 19 August 2008
Author:brion
Status:old
Tags:
Comment:
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?
Modified paths:
  • /trunk/phase3/includes/filerepo/FSRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalRepo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/FSRepo.php
@@ -519,13 +519,13 @@
520520 if ( !isset( $this->simpleCleanPairs ) ) {
521521 global $IP;
522522 $this->simpleCleanPairs = array(
523 - $this->directory => "mwrepo://{$this->name}/public",
524 - "{$this->directory}/temp" => "mwrepo://{$this->name}/temp",
 523+ $this->directory => 'public',
 524+ "{$this->directory}/temp" => 'temp',
525525 $IP => '$IP',
526526 dirname( __FILE__ ) => '$IP/extensions/WebStore',
527527 );
528528 if ( $this->deletedDir ) {
529 - $this->simpleCleanPairs[$this->deletedDir] = "mwrepo://{$this->name}/deleted";
 529+ $this->simpleCleanPairs[$this->deletedDir] = 'deleted';
530530 }
531531 }
532532 return strtr( $param, $this->simpleCleanPairs );
Index: trunk/phase3/includes/filerepo/LocalRepo.php
@@ -10,21 +10,6 @@
1111 var $fileFromRowFactory = array( 'LocalFile', 'newFromRow' );
1212 var $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' );
1313
14 - function __construct( $info ) {
15 - parent::__construct( $info );
16 -
17 - # Initialize simpleCleanPairs, to make errors less misleading
18 - global $IP;
19 - $this->simpleCleanPairs = array(
20 - $this->directory => '$wgUploadDirectory',
21 - wfTempDir() => '{wfTempDir()}',
22 - $IP => '$IP',
23 - );
24 - if ( $this->deletedDir ) {
25 - $this->simpleCleanPairs[$this->deletedDir] = '{$wgFileStore[\'deleted\'][\'directory\']}';
26 - }
27 - }
28 -
2914 function getSlaveDB() {
3015 return wfGetDB( DB_SLAVE );
3116 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r39608More descriptive sanitized paths for file repo errorskrimpet20:06, 18 August 2008

Status & tagging log