From 2180cc10fc540eb2dfc832a1d47605e4d3025155 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 27 Mar 2023 14:43:10 +0200 Subject: always use 3rd position for cache miss return value --- it_url.class | 4 ++-- 1 file 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); -- cgit v1.2.3