diff options
-rw-r--r-- | it_url.class | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/it_url.class b/it_url.class index f00f5b6..1c3bfb8 100644 --- a/it_url.class +++ b/it_url.class @@ -525,7 +525,7 @@ static function get_cache_filename($p) /** * Store contents of url in a file and return file name. Threadsafe: Provides locking. Called statically. - * Requires webserver writeable directory in $p['cachdedir']. Params in associative array p: + * Requires webserver writeable directory in $p['cachdedir']. Sends it::error on fails by default. Params: * @param $p['url'] url to get * @param $p['id'] dirname for cached files; same id should have same expire policy * @param $p['headers'] optional array of HTTP headers to send @@ -547,7 +547,7 @@ static function get_cache($p = array()) if (!$p['id'] && $p['maxage']) it::error("calling get_cache with maxage and without id"); - $p += ['timeout' => 10, 'maxage' => 86400, 'cleanbefore' => 7200, 'lock' => true, 'it_error' => $p['safety'] == 0 ? false : ($p['safety'] == 2 ? ['fatal' => true] : [])]; + $p += ['timeout' => 10, 'maxage' => 86400, 'cleanbefore' => 7200, 'lock' => true, 'it_error' => $p['safety'] === 0 ? false : ($p['safety'] == 2 ? ['fatal' => true] : [])]; $p['totaltimeout'] = $p['timeout']; $path = it_url::get_cache_filename($p); # Must be before changing cachedir below $p['cachedir'] = it_url::get_cache_dir($p); @@ -683,7 +683,7 @@ static function get_cache_contents($p) $result = self::_postprocess($result, $p); } else - $result = it::error((array)$p['it_error'] + ['title' => $p['safety'] == 0 ? false : "failed getting " . it_url::absolute($p['url']), 'body' => $p]); + $result = it::error((array)$p['it_error'] + ['title' => $p['safety'] === 0 ? false : "failed getting " . it_url::absolute($p['url']), 'body' => $p]); return $result; } |