summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2012-03-20 17:23:30 +0000
committerChristian Schneider2012-03-20 17:23:30 +0000
commitcf7594b3a903c866ed4b32ffaec01cbd6ddc5cb6 (patch)
treea6c358c409c2480b016cbc928820cf8c11f2dd64
parent8a9d596c3c9e112025e594bff402a479c149c2d9 (diff)
downloaditools-cf7594b3a903c866ed4b32ffaec01cbd6ddc5cb6.tar.gz
itools-cf7594b3a903c866ed4b32ffaec01cbd6ddc5cb6.tar.bz2
itools-cf7594b3a903c866ed4b32ffaec01cbd6ddc5cb6.zip
Fix getcache not updating processed file if another processed file updated source in the meantime
-rw-r--r--it_url.class9
1 files changed, 2 insertions, 7 deletions
diff --git a/it_url.class b/it_url.class
index 753164a..305bde9 100644
--- a/it_url.class
+++ b/it_url.class
@@ -530,12 +530,7 @@ function get_cache($p = array())
if ($filemtime = $newfile ? true : it_url::_expired($path, $p['maxage'])) # Outdated(non-zero int) or non-existant(true)?
{
- if ($result === true && $filemtime !== true) # Source not modified, destination exists => touch
- {
- EDC('getcache', "processtouch", $p['url'], $path);
- touch($path);
- }
- else if ($lock = it_url::_lock($path))
+ if ($lock = it_url::_lock($path))
{
# Touch existing file to prevent locking other getters while refreshing
if ($filemtime !== true)
@@ -717,7 +712,7 @@ function redirect($url = null, $type = "temporary")
$url = preg_replace("/[\r\n].*/", '', it_url::absolute($url)); # Security: cut after CR/LF
if (EDC('noredir'))
- echo "<a href='" . htmlspecialchars($url) . "'>" . htmlspecialchars($url) . "</a> (HTTP/1.1 $code, $type redirect)<br />Trace: " . it_debug::backtrace();
+ echo a(array('href' => $url), Q($url)) . Q(" (HTTP/1.1 $code, $type redirect)") . br() . Q("Trace: " . it_debug::backtrace());
else
header('Location: ' . it_untaint($url, TC_SELF), true, $code);
exit;