diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2008-04-01 09:04:13 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2008-04-01 09:04:13 +0200 |
commit | c2d63a1630878abe2fa201d22671ca7f798b2ba7 (patch) | |
tree | 69f5fd87c25ac310503293523f559f132945ca59 | |
parent | 8538c04d27c768e7d5e6a5740395fb89163acfc7 (diff) |
Don't stores the tmp StatsFile if empty instead of storing it then deleting it..
-rw-r--r-- | Badges_v2.php | 7 |
1 files 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) |