Add HTML Purify to BBCode::convert

- Replace previous HTML cleanup using DOMDocument
- Remove obsolete HTML::sanitizeCSS method
- Use Strings::autoLinkRegEx for PageInfo::getRelevantUrlFromBody
- Update previous tests expectations
- Add new specific XSS tests
This commit is contained in:
Hypolite Petovan 2020-12-04 07:27:13 -05:00
parent d8e3b841f8
commit a0f6d678c4
4 changed files with 83 additions and 111 deletions

View file

@ -265,7 +265,7 @@ class PageInfo
}
if (!$matches && $searchNakedUrls) {
preg_match('~(?<=\W|^)(?<![=\]])(https?://.+)$~is', $body, $matches);
preg_match(Strings::autoLinkRegEx(), $body, $matches);
if ($matches && !Strings::endsWith($body, $matches[1])) {
unset($matches);
}