]> git.mxchange.org Git - friendica-addons.git/commitdiff
Move internal recursion-counter to the end of all cur/fetchUrl parameters
authorPhilipp Holzer <admin+github@philipp.info>
Mon, 10 Jun 2019 12:34:53 +0000 (14:34 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Mon, 10 Jun 2019 12:34:53 +0000 (14:34 +0200)
mailstream/mailstream.php
pumpio/pumpio.php
statusnet/statusnet.php
twitter/twitter.php

index 99574f6d0c4f0f6145a9a2b7d30e1b040b6ebb26..e4abc597f8e08cd016611133bf2f47c3e1d35407 100644 (file)
@@ -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),
index a8106a721560432d80e07a369fd2f42ff16d0db7..c4093f2b8ff89fd1b04a55612cc07c1125ed0879 100644 (file)
@@ -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();
 }
 
 /*
index 5638a7991673f5536d3db83e6bd56e28c74ead63..583eff8809177d1d5f20019f5ba3c7f4a9075b82 100644 (file)
@@ -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);
index 166c99ef907fc560968a2181f276eccf7085a719..4065691828f30610c35e8e259f5327efd1b03f61 100644 (file)
@@ -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);