Browse Source

Do not fill in missing booleans in configurations

master
J. King 1 year ago
parent
commit
b55cee2934
  1. 8
      lib/AbstractSanitizer.php

8
lib/AbstractSanitizer.php

@ -532,7 +532,9 @@ abstract class AbstractSanitizer {
}
// finally handle the boolean options
foreach (["allowCustomElements", "allowUnknownMarkup", "allowComments", "allowProcessingInstructions", "nullNamespaceAsHtml"] as $opt) {
$out[$opt] = (bool) $config[$opt] ?? self::DEFAULT_CONF[$opt];
if (isset($config[$opt])) {
$out[$opt] = (bool) $config[$opt];
}
}
// use the normalized configuration
$this->config = $out;
@ -600,7 +602,9 @@ abstract class AbstractSanitizer {
}
// finally handle the boolean options
foreach (["allowCustomElements", "allowUnknownMarkup", "allowComments", "allowProcessingInstructions", "nullNamespaceAsHtml"] as $opt) {
$out[$opt] = $config[$opt];
if (isset($config[$opt])) {
$out[$opt] = $config[$opt];
}
}
// return the transformed configuration
return $out;

Loading…
Cancel
Save