From a90cf1fb8cb3a005585db14f300e5a05bccc3954 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 4 May 2019 21:04:58 +0100 Subject: [PATCH] filebackend: Restore TempFSFile shutdown-purge functionality Introduced in 603d8970c3575 to handle purging of tmp files in case of fatals and other ways that the PHP process can exit in a way that (some) destructors might not run, but shutdown callbacks do. It did not appear to work as it looped over the array values, which are all int(1), instead of the array keys. Change-Id: I83f0c8ea15e2bfb2bdc9aa2b4015635771abe394 --- includes/libs/filebackend/fsfile/TempFSFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/libs/filebackend/fsfile/TempFSFile.php b/includes/libs/filebackend/fsfile/TempFSFile.php index 321424f94b..b993626fda 100644 --- a/includes/libs/filebackend/fsfile/TempFSFile.php +++ b/includes/libs/filebackend/fsfile/TempFSFile.php @@ -178,7 +178,7 @@ class TempFSFile extends FSFile { * This method should only be called internally */ public static function purgeAllOnShutdown() { - foreach ( self::$pathsCollect as $path ) { + foreach ( self::$pathsCollect as $path => $unused ) { Wikimedia\suppressWarnings(); unlink( $path ); Wikimedia\restoreWarnings(); -- 2.20.1