X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Ffilebackend%2FFileBackendMultiWrite.php;h=f92d5fa0a9a7ed92f5abd474f2d6266ef19414af;hp=655a71048c00dd227c782f5d6a810dfb0ba8200b;hb=c13fee87d42bdd6fdf6764edb6f6475c14c27749;hpb=bdc88d57e7e10b2554d7cbcf3914113a44c81719 diff --git a/includes/libs/filebackend/FileBackendMultiWrite.php b/includes/libs/filebackend/FileBackendMultiWrite.php index 655a71048c..f92d5fa0a9 100644 --- a/includes/libs/filebackend/FileBackendMultiWrite.php +++ b/includes/libs/filebackend/FileBackendMultiWrite.php @@ -87,9 +87,6 @@ class FileBackendMultiWrite extends FileBackend { * This will apply such updates post-send for web requests. Note that * any checks from "syncChecks" are still synchronous. * - * Bogus warning - * @suppress PhanAccessMethodProtected - * * @param array $config * @throws FileBackendError */ @@ -260,11 +257,11 @@ class FileBackendMultiWrite extends FileBackend { $status->fatal( 'backend-fail-synced', $path ); continue; } - if ( $this->syncChecks & self::CHECK_SIZE ) { - if ( $cStat['size'] != $mStat['size'] ) { // wrong size - $status->fatal( 'backend-fail-synced', $path ); - continue; - } + if ( ( $this->syncChecks & self::CHECK_SIZE ) + && $cStat['size'] != $mStat['size'] + ) { // wrong size + $status->fatal( 'backend-fail-synced', $path ); + continue; } if ( $this->syncChecks & self::CHECK_TIME ) { $mTs = wfTimestamp( TS_UNIX, $mStat['mtime'] ); @@ -274,16 +271,12 @@ class FileBackendMultiWrite extends FileBackend { continue; } } - if ( $this->syncChecks & self::CHECK_SHA1 ) { - if ( $cBackend->getFileSha1Base36( $cParams ) !== $mSha1 ) { // wrong SHA1 - $status->fatal( 'backend-fail-synced', $path ); - continue; - } - } - } else { // file is not in master - if ( $cStat ) { // file should not exist + if ( ( $this->syncChecks & self::CHECK_SHA1 ) && $cBackend->getFileSha1Base36( $cParams ) !== $mSha1 ) { // wrong SHA1 $status->fatal( 'backend-fail-synced', $path ); + continue; } + } elseif ( $cStat ) { // file is not in master; file should not exist + $status->fatal( 'backend-fail-synced', $path ); } } }