0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-01-03 05:11:52 +00:00

Fix PHP 5.3 compatibility, fixes #125.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
This commit is contained in:
Edward Z. Yang 2017-03-08 17:46:29 -08:00
parent b90295deda
commit 8836ae05aa

View File

@ -348,9 +348,10 @@ class HTMLPurifier_Lexer
$html = preg_replace('#<\?.+?\?>#s', '', $html); $html = preg_replace('#<\?.+?\?>#s', '', $html);
} }
$hidden_elements = $config->get('Core.HiddenElements');
if ($config->get('Core.AggressivelyRemoveScript') && if ($config->get('Core.AggressivelyRemoveScript') &&
!($config->get('HTML.Trusted') || !$config->get('Core.RemoveScriptContents') !($config->get('HTML.Trusted') || !$config->get('Core.RemoveScriptContents')
|| empty($config->get('Core.HiddenElements')["script"]))) { || empty($hidden_elements["script"]))) {
$html = preg_replace('#<script[^>]*>.*?</script>#i', '', $html); $html = preg_replace('#<script[^>]*>.*?</script>#i', '', $html);
} }