From: Philipp Holzer Date: Mon, 10 Jun 2019 12:34:53 +0000 (+0200) Subject: Move internal recursion-counter to the end of all cur/fetchUrl parameters X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8562422ee2251e67a16339b555605ecbce541f86;p=friendica-addons.git Move internal recursion-counter to the end of all cur/fetchUrl parameters --- diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 99574f6d..e4abc597 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -157,9 +157,8 @@ function mailstream_do_images($a, &$item, &$attachments) { preg_match_all("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", $item["body"], $matches1); preg_match_all("/\[img\](.*?)\[\/img\]/ism", $item["body"], $matches2); foreach (array_merge($matches1[3], $matches2[1]) as $url) { - $redirects = 0; $cookiejar = tempnam(get_temppath(), 'cookiejar-mailstream-'); - $curlResult = Network::fetchUrlFull($url, true, $redirects, 0, null, $cookiejar); + $curlResult = Network::fetchUrlFull($url, true, 0, '', $cookiejar); $attachments[$url] = [ 'data' => $curlResult->getBody(), 'guid' => hash("crc32", $url), diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index a8106a72..c4093f2b 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -1629,7 +1629,7 @@ function pumpio_fetchallcomments(App $a, $uid, $id) function pumpio_reachable($url) { - return Network::curl($url, false, $redirects, ['timeout'=>10])->isSuccess(); + return Network::curl($url, false, ['timeout' => 10])->isSuccess(); } /* diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 5638a799..583eff88 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -1483,7 +1483,7 @@ function statusnet_convertmsg(App $a, $body, $no_tags = false) } elseif ($oembed_data->type != "link") { $body = str_replace($search, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body); } else { - $img_str = Network::fetchUrl($expanded_url, true, $redirects, 4); + $img_str = Network::fetchUrl($expanded_url, true, 4); $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); diff --git a/twitter/twitter.php b/twitter/twitter.php index 166c99ef..40656918 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -1184,7 +1184,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture) } elseif ($oembed_data->type != 'link') { $body = str_replace($url->url, '[url=' . $expanded_url . ']' . $url->display_url . '[/url]', $body); } else { - $img_str = Network::fetchUrl($final_url, true, $redirects, 4); + $img_str = Network::fetchUrl($final_url, true, 4); $tempfile = tempnam(get_temppath(), 'cache'); file_put_contents($tempfile, $img_str);