diff options
author | Aaron Schulz <aschulz@wikimedia.org> | 2012-10-31 23:36:49 -0700 |
---|---|---|
committer | Aaron Schulz <aschulz@wikimedia.org> | 2012-10-31 23:36:49 -0700 |
commit | 9c7018e4fd29d541c3c5bcd65095e2cfff886c64 (patch) | |
tree | 6e0c4ea74d462cae4566be3413bfefc39c6063c8 /includes/filebackend/FileOp.php | |
parent | 63fa9df088280df300e43bf691bf823e32d8c151 (diff) | |
download | mediawikicore-9c7018e4fd29d541c3c5bcd65095e2cfff886c64.tar.gz mediawikicore-9c7018e4fd29d541c3c5bcd65095e2cfff886c64.zip |
[FileBackend] Check if paths are writable for delete ops too.
* Also clarified the docs around isPathUsableInternal().
Change-Id: I3fc10fce43e040f45045d6da69f0211e9ab4155d
Diffstat (limited to 'includes/filebackend/FileOp.php')
-rw-r--r-- | includes/filebackend/FileOp.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/includes/filebackend/FileOp.php b/includes/filebackend/FileOp.php index 20dfda2a3536..ff1b604337e6 100644 --- a/includes/filebackend/FileOp.php +++ b/includes/filebackend/FileOp.php @@ -488,7 +488,7 @@ class StoreFileOp extends FileOp { $this->params['dst'], $this->backend->maxFileSizeInternal() ); $status->fatal( 'backend-fail-store', $this->params['src'], $this->params['dst'] ); return $status; - // Check if a file can be placed at the destination + // 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-store', $this->params['src'], $this->params['dst'] ); @@ -551,7 +551,7 @@ class CreateFileOp extends FileOp { $this->params['dst'], $this->backend->maxFileSizeInternal() ); $status->fatal( 'backend-fail-create', $this->params['dst'] ); return $status; - // Check if a file can be placed at the destination + // 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-create', $this->params['dst'] ); @@ -624,7 +624,7 @@ class CopyFileOp extends FileOp { $status->fatal( 'backend-fail-notexists', $this->params['src'] ); return $status; } - // Check if a file can be placed at the destination + // 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-copy', $this->params['src'], $this->params['dst'] ); @@ -700,7 +700,7 @@ class MoveFileOp extends FileOp { $status->fatal( 'backend-fail-notexists', $this->params['src'] ); return $status; } - // Check if a file can be placed at the destination + // 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'] ); @@ -781,6 +781,11 @@ class DeleteFileOp extends FileOp { $status->fatal( 'backend-fail-notexists', $this->params['src'] ); 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'] ); + return $status; } // Update file existence predicates $predicates['exists'][$this->params['src']] = false; |