From: Aaron Schulz Date: Sat, 6 Jul 2013 22:06:38 +0000 (-0700) Subject: filebackend: normalize paths used in locking X-Git-Tag: 1.31.0-rc.0~19196^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=5749bd7352d899f8f539771fe2d843d3f1c49239;p=lhc%2Fweb%2Fwiklou.git filebackend: normalize paths used in locking Change-Id: I0d823e4d20c89a22ad89a6af8739075f7a10c235 --- 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 ); }