From 5749bd7352d899f8f539771fe2d843d3f1c49239 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 6 Jul 2013 15:06:38 -0700 Subject: [PATCH] filebackend: normalize paths used in locking Change-Id: I0d823e4d20c89a22ad89a6af8739075f7a10c235 --- includes/filebackend/FileBackend.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 9b4760af43..bdeb578eff 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -1159,6 +1159,7 @@ abstract class FileBackend { * @return Status */ final public function lockFiles( array $paths, $type ) { + $paths = array_map( 'FileBackend::normalizeStoragePath', $paths ); return $this->lockManager->lock( $paths, $type ); } @@ -1170,6 +1171,7 @@ abstract class FileBackend { * @return Status */ final public function unlockFiles( array $paths, $type ) { + $paths = array_map( 'FileBackend::normalizeStoragePath', $paths ); return $this->lockManager->unlock( $paths, $type ); } @@ -1187,6 +1189,13 @@ abstract class FileBackend { * @return ScopedLock|null Returns null on failure */ final public function getScopedFileLocks( array $paths, $type, Status $status ) { + if ( $type === 'mixed' ) { + foreach ( $paths as &$typePaths ) { + $typePaths = array_map( 'FileBackend::normalizeStoragePath', $typePaths ); + } + } else { + $paths = array_map( 'FileBackend::normalizeStoragePath', $paths ); + } return ScopedLock::factory( $this->lockManager, $paths, $type, $status ); } -- 2.20.1