From c14c9a3279d855c5aa49d278997b030c0e8b1fd1 Mon Sep 17 00:00:00 2001 From: Aaron Date: Tue, 17 Apr 2012 10:56:35 -0700 Subject: [PATCH] [FileRepo] Use resolveToStoragePath() in more places. Change-Id: I97d4e723f8756f44873a4af2bc3b73ea1965f152 --- includes/filerepo/FileRepo.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) 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; -- 2.20.1