r39608 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39607‎ | r39608 | r39609 >
Date:20:06, 18 August 2008
Author:krimpet
Status:old (Comments)
Tags:
Comment:
More descriptive sanitized paths for file repo errors
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 => 'public',
524 - "{$this->directory}/temp" => 'temp',
 523+ $this->directory => "mwrepo://{$this->name}/public",
 524+ "{$this->directory}/temp" => "mwrepo://{$this->name}/temp",
525525 $IP => '$IP',
526526 dirname( __FILE__ ) => '$IP/extensions/WebStore',
527527 );
528528 if ( $this->deletedDir ) {
529 - $this->simpleCleanPairs[$this->deletedDir] = 'deleted';
 529+ $this->simpleCleanPairs[$this->deletedDir] = "mwrepo://{$this->name}/deleted";
530530 }
531531 }
532532 return strtr( $param, $this->simpleCleanPairs );
Index: trunk/phase3/includes/filerepo/LocalRepo.php
@@ -10,6 +10,21 @@
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+
1429 function getSlaveDB() {
1530 return wfGetDB( DB_SLAVE );
1631 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r39652Revert r39608 "More descriptive sanitized paths for file repo errors"...brion18:45, 19 August 2008

Comments

#Comment by 😂 (talk | contribs)   20:44, 11 March 2009

Reverted in r39652

Status & tagging log