From: Brad Jorsch Date: Tue, 26 Feb 2013 23:15:17 +0000 (-0800) Subject: Fix UploadStash::removeFile() error X-Git-Tag: 1.31.0-rc.0~20552^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=8049aa338451fa96ae0ee527df15a7b1a2ca27a3;p=lhc%2Fweb%2Fwiklou.git 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 --- 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(