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),
function pumpio_reachable($url)
{
- return Network::curl($url, false, $redirects, ['timeout'=>10])->isSuccess();
+ return Network::curl($url, false, ['timeout' => 10])->isSuccess();
}
/*
} 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);
} 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);