From 3c8cb11aee81340d69cfc9c4a89395f95f12a3c8 Mon Sep 17 00:00:00 2001 From: rob1n Date: Thu, 12 Apr 2007 16:31:47 +0000 Subject: [PATCH] Delete the cache in tmp even if the copy failed. Props andy. fixes #4141 git-svn-id: https://develop.svn.wordpress.org/trunk@5255 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/cache.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-includes/cache.php b/wp-includes/cache.php index b776d91ba4..bbdf84c437 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -340,10 +340,9 @@ class WP_Object_Cache { fputs($fd, $serial); fclose($fd); if (!@ rename($temp_file, $cache_file)) { - if (@ copy($temp_file, $cache_file)) - @ unlink($temp_file); - else + if (!@ copy($temp_file, $cache_file)) $errors++; + @ unlink($temp_file); } @ chmod($cache_file, $file_perms); }