diff --git a/classes/security/EmbedFilter.class.php b/classes/security/EmbedFilter.class.php index 0b5d5dd4f..15f6e1ae8 100644 --- a/classes/security/EmbedFilter.class.php +++ b/classes/security/EmbedFilter.class.php @@ -347,14 +347,14 @@ class EmbedFilter } } - if(!$isWhiteDomain && !$isWhiteMimetype && $ext) + if($isWhiteDomain && $isWhiteMimetype && $ext) { $isWhiteExt = $this->isWhiteExt($ext); } - if(!$isWhiteDomain && !$isWhiteMimetype && !$isWhiteExt) + if(!$isWhiteDomain || !$isWhiteMimetype || !$isWhiteExt) { - $content = str_replace($objectTag, htmlspecialchars($objectTag), $content); + $content = str_replace($objectTag, htmlspecialchars($objectTag, ENT_COMPAT, 'UTF-8', false), $content); } } } @@ -400,14 +400,14 @@ class EmbedFilter } } - if(!$isWhiteDomain && !$isWhiteMimetype && $ext) + if($isWhiteDomain && $isWhiteMimetype && $ext) { $isWhiteExt = $this->isWhiteExt($ext); } - if(!$isWhiteDomain && !$isWhiteMimetype && !$isWhiteExt) + if(!$isWhiteDomain || !$isWhiteMimetype || !$isWhiteExt) { - $content = str_replace($embedTag, htmlspecialchars($embedTag), $content); + $content = str_replace($embedTag, htmlspecialchars($embedTag, ENT_COMPAT, 'UTF-8', false), $content); } } } @@ -450,7 +450,7 @@ class EmbedFilter if(!$isWhiteDomain) { - $content = str_replace($iframeTag, htmlspecialchars($iframeTag), $content); + $content = str_replace($iframeTag, htmlspecialchars($iframeTag, ENT_COMPAT, 'UTF-8', false), $content); } } } @@ -483,14 +483,14 @@ class EmbedFilter $ext = strtolower(substr(strrchr($parser->iNodeAttributes['value'], "."), 1)); $isWhiteDomain = $this->isWhiteDomain($parser->iNodeAttributes['value']); - if(!$isWhiteDomain && $ext) + if($isWhiteDomain && $ext) { $isWhiteExt = $this->isWhiteExt($ext); } - if(!$isWhiteDomain && !$isWhiteExt) + if(!$isWhiteDomain || !$isWhiteExt) { - $content = str_replace($paramTag, htmlspecialchars($paramTag), $content); + $content = str_replace($paramTag, htmlspecialchars($paramTag, ENT_COMPAT, 'UTF-8', false), $content); } } } @@ -568,7 +568,7 @@ class EmbedFilter if($m[1] == 'param') { - if(strpos(strtolower($m[0]), 'allowscriptaccess')) + if(stripos($m[0], 'allowscriptaccess')) { $m[0] = '