X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Ffilebackend%2Ffileop%2FDeleteFileOp.php;h=3b48881e72201afe6a65c7f4a8a2eb692b7f0e8e;hb=5a451fd01be397db3209c1881a335423706da5c2;hp=1047a985ec1bd9ee3718975907aae8e99e41d5cc;hpb=eb70451cec6409526c8feaedf55700f51e10ffe7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/filebackend/fileop/DeleteFileOp.php b/includes/libs/filebackend/fileop/DeleteFileOp.php index 1047a985ec..3b48881e72 100644 --- a/includes/libs/filebackend/fileop/DeleteFileOp.php +++ b/includes/libs/filebackend/fileop/DeleteFileOp.php @@ -32,8 +32,10 @@ class DeleteFileOp 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) @@ -46,10 +48,8 @@ class DeleteFileOp extends FileOp { return $status; } - // Check if a file can be placed/changed at the source - } elseif ( !$this->backend->isPathUsableInternal( $this->params['src'] ) ) { - $status->fatal( 'backend-fail-usable', $this->params['src'] ); - $status->fatal( 'backend-fail-delete', $this->params['src'] ); + } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) { + $status->fatal( 'backend-fail-stat', $this->params['src'] ); return $status; }