Merge pull request #1190 from MrPetovan/bug/10634-markdown-html
[markdown] Escape HTML characters before running Markdown::toBBCode()
This commit is contained in:
commit
c22cb063d7
|
@ -56,6 +56,10 @@ function markdown_post_local_start(App $a, &$request) {
|
||||||
// Escape mentions which username can contain Markdown-like characters
|
// Escape mentions which username can contain Markdown-like characters
|
||||||
// See https://github.com/friendica/friendica/issues/9486
|
// See https://github.com/friendica/friendica/issues/9486
|
||||||
return \Friendica\Util\Strings::performWithEscapedBlocks($body, '/[@!][^@\s]+@[^\s]+\w/', function ($text) {
|
return \Friendica\Util\Strings::performWithEscapedBlocks($body, '/[@!][^@\s]+@[^\s]+\w/', function ($text) {
|
||||||
|
// Markdown accepts literal HTML but we do not in post body, so we need to escape all chevrons
|
||||||
|
// See https://github.com/friendica/friendica/issues/10634
|
||||||
|
$text = \Friendica\Util\Strings::escapeHtml($text);
|
||||||
|
|
||||||
return Markdown::toBBCode($text);
|
return Markdown::toBBCode($text);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user