summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2025-09-26 22:01:27 +0200
committerUrban Müller2025-09-26 22:01:27 +0200
commit8ff8b9aa50b5e2ac7a7cd1d872f4718facb4d9ae (patch)
treeb29da0ee8f0464a690e8d7028fac5ba20a9c297c
parentc78ec2507e5391a902ce08141c1e20e578a6f345 (diff)
downloaditools-8ff8b9aa50b5e2ac7a7cd1d872f4718facb4d9ae.tar.gz
itools-8ff8b9aa50b5e2ac7a7cd1d872f4718facb4d9ae.tar.bz2
itools-8ff8b9aa50b5e2ac7a7cd1d872f4718facb4d9ae.zip
do not consider a (postprocessed) empty array a download failureHEADmaster
-rw-r--r--it_url.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/it_url.class b/it_url.class
index 2c4030c..4d4175f 100644
--- a/it_url.class
+++ b/it_url.class
@@ -82,7 +82,10 @@ static function is_reachable($p = [])
static function _postprocess($data, $p)
{
if ($p['postprocess'])
- $data = ($t = $p['postprocess']($data, ['it_error' => $p['retries'] > 0 ? false : (array)$p['it_error'] + ['title' => "invalid content from " . $p['url']]])) && $p['checkonly'] ? $data : $t;
+ {
+ $processed = $p['postprocess']($data, ['it_error' => $p['retries'] > 0 ? false : (array)$p['it_error'] + ['title' => "invalid content from " . $p['url']]]);
+ $data = $processed !== null && $processed !== false && $p['checkonly'] ? $data : $processed;
+ }
return $data;
}