From: Aaron Date: Tue, 17 Apr 2012 17:56:35 +0000 (-0700) Subject: [FileRepo] Use resolveToStoragePath() in more places. X-Git-Tag: 1.31.0-rc.0~23884^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=c14c9a3279d855c5aa49d278997b030c0e8b1fd1;p=lhc%2Fweb%2Fwiklou.git [FileRepo] Use resolveToStoragePath() in more places. Change-Id: I97d4e723f8756f44873a4af2bc3b73ea1965f152 --- diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 8fe786ab3f..d38f5cae8d 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -706,9 +706,7 @@ class FileRepo { } // Resolve source to a storage path if virtual - if ( self::isVirtualUrl( $srcPath ) ) { - $srcPath = $this->resolveVirtualUrl( $srcPath ); - } + $srcPath = $this->resolveToStoragePath( $srcPath ); // Get the appropriate file operation if ( FileBackend::isStoragePath( $srcPath ) ) { @@ -767,9 +765,7 @@ class FileRepo { $path = $this->getZonePath( $zone ) . "/$rel"; } else { // Resolve source to a storage path if virtual - if ( self::isVirtualUrl( $path ) ) { - $path = $this->resolveVirtualUrl( $path ); - } + $path = $this->resolveToStoragePath( $path ); } $operations[] = array( 'op' => 'delete', 'src' => $path ); } @@ -1007,9 +1003,7 @@ class FileRepo { foreach ( $triplets as $i => $triplet ) { list( $srcPath, $dstRel, $archiveRel ) = $triplet; // Resolve source to a storage path if virtual - if ( $this->isVirtualUrl( $srcPath ) ) { - $srcPath = $this->resolveVirtualUrl( $srcPath ); - } + $srcPath = $this->resolveToStoragePath( $srcPath ); if ( !$this->validateFilename( $dstRel ) ) { throw new MWException( 'Validation error in $dstRel' ); } @@ -1128,9 +1122,7 @@ class FileRepo { public function fileExistsBatch( array $files ) { $result = array(); foreach ( $files as $key => $file ) { - if ( self::isVirtualUrl( $file ) ) { - $file = $this->resolveVirtualUrl( $file ); - } + $file = $this->resolveToStoragePath( $file ); $result[$key] = $this->backend->fileExists( array( 'src' => $file ) ); } return $result;