]> git.mxchange.org Git - friendica-addons.git/commitdiff
[mailstream] Support new img format with alt text
authorMatthew Exon <github.mexon@spamgourmet.com>
Sun, 29 Sep 2019 20:07:11 +0000 (22:07 +0200)
committerMatthew Exon <github.mexon@spamgourmet.com>
Sun, 29 Sep 2019 20:10:51 +0000 (22:10 +0200)
mailstream/mailstream.php

index 32d021382877784569b890a6ee814c54ae3cf74b..563dd9061c6dbb39a574e56287b6767bffec5e14 100644 (file)
@@ -163,7 +163,8 @@ function mailstream_do_images($a, &$item, &$attachments) {
        $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) {
+       preg_match_all("/\[img\=([^\]]*)\]([^[]*)\[\/img\]/ism", $item["body"], $matches3);
+       foreach (array_merge($matches1[3], $matches2[1], $matches3[1]) as $url) {
                $components = parse_url($url);
                $cookiejar = tempnam(get_temppath(), 'cookiejar-mailstream-');
                $curlResult = Network::fetchUrlFull($url, true, 0, '', $cookiejar);