]> git.mxchange.org Git - friendica.git/commitdiff
Increase video tag regular expression specificity to decrease backtrack in BBCode...
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 13 Mar 2021 14:06:52 +0000 (09:06 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 13 Mar 2021 14:06:52 +0000 (09:06 -0500)
src/Content/Text/BBCode.php

index 99737058550e445e9e1787c672ce594a6d8f051c..1a930088107b698df9afcab031d4fcba7cf0366d 100644 (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