]> git.mxchange.org Git - friendica.git/commitdiff
Issue 12870: Support for zmg elements from Hubzilla
authorMichael <heluecht@pirati.ca>
Sat, 18 Mar 2023 07:05:38 +0000 (07:05 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 18 Mar 2023 07:05:38 +0000 (07:05 +0000)
src/Content/Text/BBCode.php

index 2e133372d5e98b58042653eba5490ad7cb4c78fa..d329c1e326b6bb0374a11475a65f2dab7e1887c1 100644 (file)
@@ -1562,7 +1562,7 @@ class BBCode
                                $text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: $1px;" >', $text);
 
                                $text = preg_replace_callback(
-                                       "/\[img\=(.*?)\](.*?)\[\/img\]/ism",
+                                       "/\[[iz]mg\=(.*?)\](.*?)\[\/[iz]mg\]/ism",
                                        function ($matches) use ($simple_html, $uriid) {
                                                $matches[1] = self::proxyUrl($matches[1], $simple_html, $uriid);
                                                $matches[2] = htmlspecialchars($matches[2], ENT_COMPAT);
@@ -1574,7 +1574,7 @@ class BBCode
                                // Images
                                // [img]pathtoimage[/img]
                                $text = preg_replace_callback(
-                                       "/\[img\](.*?)\[\/img\]/ism",
+                                       "/\[[iz]mg\](.*?)\[\/[iz]mg\]/ism",
                                        function ($matches) use ($simple_html, $uriid) {
                                                if (strpos($matches[1], "data:image/") === 0) {
                                                        return $matches[0];