From 79fd50e172a50918d9018f54ab6e40606181f95b Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 15 Sep 2020 13:20:03 +0200 Subject: Make itools PHP 8 compatible --- it_url.class | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'it_url.class') diff --git a/it_url.class b/it_url.class index 6b1f81c..c1d7ec5 100644 --- a/it_url.class +++ b/it_url.class @@ -361,13 +361,13 @@ static function get_multi($p=null) curl_setopt($handle, CURLOPT_URL, it::replace([ '^//' => "http://" ], is_array($url) ? $url['url'] : $url)); curl_setopt_array($handle, $opts); curl_multi_add_handle($mh, $handle); - $keys[$handle] = $key; + $keys[(int)$handle] = $key; $handles[$key] = $handle; }; $closehandle = function ($key) use (&$keys, &$handles, $mh) { curl_multi_remove_handle($mh, $handles[$key]); curl_close($handles[$key]); - unset($keys[$handles[$key]]); + unset($keys[(int)$handles[$key]]); unset($handles[$key]); }; @@ -406,7 +406,7 @@ static function get_multi($p=null) { if ($info['msg'] == CURLMSG_DONE) { - $key = $keys[$info['handle']]; + $key = $keys[(int)$info['handle']]; $content = curl_multi_getcontent($info['handle']); if (isset($p['postprocess'])) $content = $p['postprocess']($content, ['it_error' => $retries[$key] < $p['retries'] ? false : (array)$p['it_error'] + ['title' => "invalid content from " . $urls[$key]]]); -- cgit v1.2.3