Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/51065


Change subject: Fix UploadStash::removeFile() error
......................................................................

Fix UploadStash::removeFile() error

If nothing has called getFile() for a key before that key is passed to
removeFileNoAuth(), UploadStash will throw a fatal error when it tries to
remove the file from the filesystem because the UploadStashFile was
never created.

Change-Id: Idf0d2c53ce759b59836f34ff5aaad393b8c371c6
---
M includes/upload/UploadStash.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/51065/1

diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php
index 65626cf..70debee 100644
--- a/includes/upload/UploadStash.php
+++ b/includes/upload/UploadStash.php
@@ -358,6 +358,9 @@
        public function removeFileNoAuth( $key ) {
                wfDebug( __METHOD__ . " clearing row $key\n" );
 
+               // Ensure we have the UploadStashFile loaded for this key
+               $this->getFile( $key );
+
                $dbw = $this->repo->getMasterDb();
 
                $dbw->delete(

-- 
To view, visit https://gerrit.wikimedia.org/r/51065
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf0d2c53ce759b59836f34ff5aaad393b8c371c6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to