]> git.mxchange.org Git - friendica.git/commitdiff
Fixed positive list
authorMichael <heluecht@pirati.ca>
Sat, 24 Feb 2024 13:56:12 +0000 (13:56 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 24 Feb 2024 13:56:12 +0000 (13:56 +0000)
src/Content/OEmbed.php

index 8274bc03c8554b2eb139a828159dd9c18b0af0d5..a30f6701fea2d0379ed439ffd4b1c87789ce1758 100644 (file)
@@ -22,8 +22,6 @@
 namespace Friendica\Content;
 
 use DOMDocument;
-use DOMNode;
-use DOMText;
 use DOMXPath;
 use Exception;
 use Friendica\Core\Cache\Enum\Duration;
@@ -161,7 +159,7 @@ class OEmbed
                        return $oembed;
                }
 
-               if (!self::isAllowedURL($oembed->url) || ($oembed->type == 'error')) {
+               if (!self::isAllowedURL($embedurl) || ($oembed->type == 'error')) {
                        $oembed->html = '';
                        $oembed->type = $data['type'];
 
@@ -332,14 +330,12 @@ class OEmbed
                        return false;
                }
 
-               $str_allowed = DI::config()->get('system', 'allowed_oembed', '');
-               if (empty($str_allowed)) {
+               $allowed = DI::config()->get('system', 'allowed_oembed', '');
+               if (empty($allowed)) {
                        return false;
                }
 
-               $allowed = explode(',', $str_allowed);
-
-               return Network::isDomainMatch($domain, $allowed);
+               return Network::isDomainMatch($domain, explode(',', $allowed));
        }
 
        /**