diff --git a/library/HTMLPurifier/Config.php b/library/HTMLPurifier/Config.php index 1ea7e84c..3e85c42a 100644 --- a/library/HTMLPurifier/Config.php +++ b/library/HTMLPurifier/Config.php @@ -419,7 +419,7 @@ class HTMLPurifier_Config */ public static function prepareArrayFromForm($array, $index, $allowed = true, $mq_fix = true, $schema = null) { $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); - $mq = get_magic_quotes_gpc() && $mq_fix; + $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema); $ret = array(); diff --git a/tests/HTMLPurifier/ConfigTest.php b/tests/HTMLPurifier/ConfigTest.php index 96bf3cfc..e0d71638 100644 --- a/tests/HTMLPurifier/ConfigTest.php +++ b/tests/HTMLPurifier/ConfigTest.php @@ -403,7 +403,7 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $config_result = HTMLPurifier_Config::loadArrayFromForm( $get, 'breakfast', array('Pancake.Served', 'Toppings', '-Toppings.Protected'), - true, // mq fix + false, // mq fix $this->schema );