1
0
Fork 0

Issue 12701: Fix Markdown problems with Quotes

This commit is contained in:
Michael 2023-03-20 21:33:39 +00:00
parent 0b1f67f5b3
commit 0f9099dec6

View 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
);