From c2d63a1630878abe2fa201d22671ca7f798b2ba7 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 1 Apr 2008 09:04:13 +0200 Subject: Don't stores the tmp StatsFile if empty instead of storing it then deleting it.. --- Badges_v2.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Badges_v2.php b/Badges_v2.php index 9cc935d..f3cd6a4 100644 --- a/Badges_v2.php +++ b/Badges_v2.php @@ -41,9 +41,10 @@ if ( ! is_file($Stats) ||(filemtime($Stats) + CACHE < $_SERVER['REQUEST_TIME'])) { system("wget -q --no-cache http://ws.audioscrobbler.com/1.0/user/".rawurlencode($username)."/profile.xml -O $Stats.tmp"); - system("mv $Stats.tmp $Stats"); - if (!filesize($Stats)) - system("rm $Stats"); + if (!filesize("$Stats.tmp")) + system("rm $Stats.tmp"); + else + system("mv $Stats.tmp $Stats"); } if ( is_file($Cache) -- cgit v1.2.3