Merge pull request #10042 from MrPetovan/bug/10041-video-regex-backtrack

Increase video tag regular expression specificity to decrease backtrack in BBCode::convert
This commit is contained in:
Michael Vogel 2021-03-13 17:54:15 +01:00 committed by GitHub
commit 751bf7ae30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1612,7 +1612,7 @@ class BBCode
//$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . DI::l10n()->t('Encrypted content') . '" title="' . '$1' . ' ' . DI::l10n()->t('Encrypted content') . '" /><br>', $Text);
// Simplify "video" element
$text = preg_replace('(\[video.*?\ssrc\s?=\s?([^\s\]]+).*?\].*?\[/video\])ism', '[video]$1[/video]', $text);
$text = preg_replace('(\[video[^\]]*?\ssrc\s?=\s?([^\s\]]+)[^\]]*?\].*?\[/video\])ism', '[video]$1[/video]', $text);
if ($try_oembed) {
// html5 video and audio