From 8049aa338451fa96ae0ee527df15a7b1a2ca27a3 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 26 Feb 2013 15:15:17 -0800 Subject: [PATCH] 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 --- includes/upload/UploadStash.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index 65626cf46a..70debee948 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -358,6 +358,9 @@ class UploadStash { 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( -- 2.20.1