summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2019-09-03 12:39:26 +0200
committerUrban Müller2019-09-03 12:39:26 +0200
commit64b784f15df826efb73453128e531c304e7add4d (patch)
treec8f75f67db163f1b0b43c095570a2033781436d6
parente3306aa9d6181ef1a72dac0e37a90a9452bc7740 (diff)
downloaditools-64b784f15df826efb73453128e531c304e7add4d.tar.gz
itools-64b784f15df826efb73453128e531c304e7add4d.tar.bz2
itools-64b784f15df826efb73453128e531c304e7add4d.zip
always set/clear errstr
-rw-r--r--it_url.class3
1 files changed, 3 insertions, 0 deletions
diff --git a/it_url.class b/it_url.class
index 80b7a44..d03ad07 100644
--- a/it_url.class
+++ b/it_url.class
@@ -251,6 +251,7 @@ function request($p=array())
$url = $this;
if ($p['url'])
$this->__construct($p['url']);
+ $this->errstr = "";
$url->headers = array();
$p['headers'] = (array)$p['headers'] + self::_default_headers($url, $p);
@@ -280,8 +281,10 @@ function request($p=array())
$result = true; # Not modified, success but no data
} else if ($url->result == 414) {
it::error((array)$p['it_error'] + ['title' => "Request-URI Too Long: " . substr($url->url, 0, 100) . "...(truncated " . (strlen($url->url) - 100) . " bytes)", 'body' => curl_getinfo($curl) + ($p['verbose'] ? ['verbose' => $this->verbose] : [])]);
+ $this->errstr = "HTTP Status " . $url->result;
} else {
$result =& $url->data;
+ $this->errstr = "HTTP Status " . $url->result;
}
} else {
$result = $this->result = false;