summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2008-04-01 09:04:13 +0200
committerHugues Hiegel <hugues@hiegel.fr>2008-04-01 09:04:13 +0200
commitc2d63a1630878abe2fa201d22671ca7f798b2ba7 (patch)
tree69f5fd87c25ac310503293523f559f132945ca59
parent8538c04d27c768e7d5e6a5740395fb89163acfc7 (diff)
Don't stores the tmp StatsFile if empty instead of storing it then deleting it..
-rw-r--r--Badges_v2.php7
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)