[mailstream] Check for malformed image URLs and do not attempt to attach them
This commit is contained in:
parent
db6d5dd85a
commit
801b88a982
1 changed files with 3 additions and 0 deletions
|
@ -166,6 +166,9 @@ function mailstream_do_images($a, &$item, &$attachments) {
|
||||||
preg_match_all("/\[img\=([^\]]*)\]([^[]*)\[\/img\]/ism", $item["body"], $matches3);
|
preg_match_all("/\[img\=([^\]]*)\]([^[]*)\[\/img\]/ism", $item["body"], $matches3);
|
||||||
foreach (array_merge($matches1[3], $matches2[1], $matches3[1]) as $url) {
|
foreach (array_merge($matches1[3], $matches2[1], $matches3[1]) as $url) {
|
||||||
$components = parse_url($url);
|
$components = parse_url($url);
|
||||||
|
if (!$components) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$cookiejar = tempnam(get_temppath(), 'cookiejar-mailstream-');
|
$cookiejar = tempnam(get_temppath(), 'cookiejar-mailstream-');
|
||||||
$curlResult = Network::fetchUrlFull($url, true, 0, '', $cookiejar);
|
$curlResult = Network::fetchUrlFull($url, true, 0, '', $cookiejar);
|
||||||
$attachments[$url] = [
|
$attachments[$url] = [
|
||||||
|
|
Loading…
Reference in a new issue