summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class5
1 files changed, 2 insertions, 3 deletions
diff --git a/it_url.class b/it_url.class
index 833d4f9..65a3954 100644
--- a/it_url.class
+++ b/it_url.class
@@ -354,7 +354,7 @@ function get_cache($p = array())
$path = it_url::get_cache_filename($p);
@mkdir(dirname($path));
- $age = time() - @filemtime($path);
+ $age = file_exists($path) ? (time() - @filemtime($path)) : 0;
# expire forgotten locks
$lockmtime = @filemtime("$path.lock");
@@ -367,8 +367,7 @@ function get_cache($p = array())
fclose($dummy);
# Touch existing file to prevent locking other getters
- if (file_exists($path))
- touch($path);
+ touch($path);
EDC('getcache', "refresh", $p['url'], $path);
if (($result = it_url::get($p['url'], $p['timeout'])))