X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Ffilebackend%2Ffileop%2FMoveFileOp.php;h=0a83370db9623c7b1c3689e85dc13a7c50d71616;hb=dcbff83dfb08f5051a6037b672370840df041f15;hp=55dca516cd9c845588bca7bb360445080426f16c;hpb=04d149b816c23b9a35db9e2258ee43eb04edd2d6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/filebackend/fileop/MoveFileOp.php b/includes/libs/filebackend/fileop/MoveFileOp.php index 55dca516cd..0a83370db9 100644 --- a/includes/libs/filebackend/fileop/MoveFileOp.php +++ b/includes/libs/filebackend/fileop/MoveFileOp.php @@ -36,8 +36,10 @@ class MoveFileOp extends FileOp { protected function doPrecheck( array &$predicates ) { $status = StatusValue::newGood(); - // Check if the source file exists - if ( !$this->fileExists( $this->params['src'], $predicates ) ) { + + // Check source file existence + $srcExists = $this->fileExists( $this->params['src'], $predicates ); + if ( $srcExists === false ) { if ( $this->getParam( 'ignoreMissingSource' ) ) { $this->doOperation = false; // no-op // Update file existence predicates (cache 404s) @@ -50,14 +52,12 @@ class MoveFileOp extends FileOp { return $status; } - // Check if a file can be placed/changed at the destination - } elseif ( !$this->backend->isPathUsableInternal( $this->params['dst'] ) ) { - $status->fatal( 'backend-fail-usable', $this->params['dst'] ); - $status->fatal( 'backend-fail-move', $this->params['src'], $this->params['dst'] ); + } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) { + $status->fatal( 'backend-fail-stat', $this->params['src'] ); return $status; } - // Check if destination file exists + // Check if an incompatible destination file exists $status->merge( $this->precheckDestExistence( $predicates ) ); $this->params['dstExists'] = $this->destExists; // see FileBackendStore::setFileCache() if ( $status->isOK() ) {