]> git.mxchange.org Git - friendica.git/commitdiff
Use the exact embed URLs
authorMichael <heluecht@pirati.ca>
Thu, 29 Feb 2024 07:40:36 +0000 (07:40 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 29 Feb 2024 07:40:36 +0000 (07:40 +0000)
src/Content/Text/BBCode.php

index c75634a6058cbe103add5437e7f1b9d69cca1833..574b9987fc23740a8f92e2467df886b6ac0dc72c 100644 (file)
@@ -1788,7 +1788,7 @@ class BBCode
                                $text = self::normalizeVideoLinks($text);
 
                                // Youtube extensions
-                               if ($try_oembed && OEmbed::isAllowedURL('https://www.youtube.com')) {
+                               if ($try_oembed && OEmbed::isAllowedURL('https://www.youtube.com/embed/')) {
                                        $text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="' . $a->getThemeInfoValue('videowidth') . '" height="' . $a->getThemeInfoValue('videoheight') . '" src="https://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $text);
                                } else {
                                        $text = preg_replace(
@@ -1799,7 +1799,7 @@ class BBCode
                                }
 
                                // Vimeo extensions
-                               if ($try_oembed && OEmbed::isAllowedURL('https://vimeo.com')) {
+                               if ($try_oembed && OEmbed::isAllowedURL('https://player.vimeo.com/video')) {
                                        $text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '<iframe width="' . $a->getThemeInfoValue('videowidth') . '" height="' . $a->getThemeInfoValue('videoheight') . '" src="https://player.vimeo.com/video/$1" frameborder="0" ></iframe>', $text);
                                } else {
                                        $text = preg_replace(