Merge pull request #896 from mexon/mat/mailstream-new-img-format
[mailstream] Support new img format with alt textpull/897/head
commit
a8b9a6c97d
|
@ -163,8 +163,12 @@ function mailstream_do_images($a, &$item, &$attachments) {
|
||||||
$attachments = [];
|
$attachments = [];
|
||||||
preg_match_all("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", $item["body"], $matches1);
|
preg_match_all("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", $item["body"], $matches1);
|
||||||
preg_match_all("/\[img\](.*?)\[\/img\]/ism", $item["body"], $matches2);
|
preg_match_all("/\[img\](.*?)\[\/img\]/ism", $item["body"], $matches2);
|
||||||
foreach (array_merge($matches1[3], $matches2[1]) as $url) {
|
preg_match_all("/\[img\=([^\]]*)\]([^[]*)\[\/img\]/ism", $item["body"], $matches3);
|
||||||
|
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 New Issue