mirror of
https://github.com/friendica/friendica
synced 2025-04-24 01:50:17 +00:00
Issue 13819: Ensure to not use OEmbed if not wanted
This commit is contained in:
parent
ac087749e3
commit
e394a6b0fa
3 changed files with 3 additions and 11 deletions
|
@ -1788,7 +1788,7 @@ class BBCode
|
|||
$text = self::normalizeVideoLinks($text);
|
||||
|
||||
// Youtube extensions
|
||||
if ($try_oembed) {
|
||||
if ($try_oembed && OEmbed::isAllowedURL('https://www.youtube.com')) {
|
||||
$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) {
|
||||
if ($try_oembed && OEmbed::isAllowedURL('https://vimeo.com')) {
|
||||
$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(
|
||||
|
@ -2057,10 +2057,7 @@ class BBCode
|
|||
);
|
||||
|
||||
// Default iframe allowed domains/path
|
||||
$allowedIframeDomains = [
|
||||
'www.youtube.com/embed/',
|
||||
'player.vimeo.com/video/',
|
||||
];
|
||||
$allowedIframeDomains = DI::config()->get('system', 'no_oembed_rich_content') ? [] : ['www.youtube.com/embed/', 'player.vimeo.com/video/'];
|
||||
|
||||
$allowedIframeDomains = array_merge(
|
||||
$allowedIframeDomains,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue