summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2023-03-27 14:43:10 +0200
committerUrban Müller2023-03-27 14:43:10 +0200
commit2180cc10fc540eb2dfc832a1d47605e4d3025155 (patch)
treed83d335a9db0bd5a4680d3adf02a8fa39836ea65
parentabf0ec9a4a770328bfb39916272d9d80654b1b75 (diff)
downloaditools-2180cc10fc540eb2dfc832a1d47605e4d3025155.tar.gz
itools-2180cc10fc540eb2dfc832a1d47605e4d3025155.tar.bz2
itools-2180cc10fc540eb2dfc832a1d47605e4d3025155.zip
always use 3rd position for cache miss return value
-rw-r--r--it_url.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it_url.class b/it_url.class
index 26794be..ff6673a 100644
--- a/it_url.class
+++ b/it_url.class
@@ -703,7 +703,7 @@ static function get_cache($p = array())
it::log('debug', 'getcachelog', $p['id'], $p['url'], !$isnewfile ? "" : "fetched=" . mb_substr(is_string($data) ? $data : "(assoc)", 0, 400));
### EDC('getcache', $success, $path); # too verbose
- return !$success ? false : ($p['returnheaders'] ? [$path, $headers] : ($p['returncachemiss'] ? [$path, $isnewfile] : $path));
+ return $success ? ($p['returnheaders'] || $p['returncachemiss'] ? [$path, $headers, $isnewfile] : $path) : false;
}
/**
@@ -714,7 +714,7 @@ static function get_cache($p = array())
*/
static function get_cache_contents($p)
{
- [$fn, $cachemiss] = self::get_cache($p + ['returncachemiss' => true]);
+ [$fn, $dummy, $cachemiss] = self::get_cache($p + ['returncachemiss' => true]);
if ($fn)
{
$result = it::file_get_contents($fn);