]> git.mxchange.org Git - friendica.git/commitdiff
Issue 12701: Fix Markdown problems with Quotes
authorMichael <heluecht@pirati.ca>
Mon, 20 Mar 2023 21:33:39 +0000 (21:33 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 20 Mar 2023 21:33:39 +0000 (21:33 +0000)
src/Content/Text/BBCode.php

index b72dcc3c4e2de709062ffc2adb520d0f919aa827..930b94ac465bae41b947cf4933df15d3e6c113d3 100644 (file)
@@ -1567,8 +1567,13 @@ class BBCode
                                        "/\[[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);
-                                               return '<img src="' . $matches[1] . '" alt="' . $matches[2] . '" title="' . $matches[2] . '">';
+                                               $alt = htmlspecialchars($matches[2], ENT_COMPAT);
+                                               // Fix for Markdown problems wirh Diaspora, see issue #12701
+                                               if (($simple_html != self::DIASPORA) || strpos($matches[2], '"') === false) {
+                                                       return '<img src="' . $matches[1] . '" alt="' . $alt . '" title="' . $alt . '">';
+                                               } else {
+                                                       return '<img src="' . $matches[1] . '" alt="' . $alt . '">';
+                                               }
                                        },
                                        $text
                                );