mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 13:21:51 +00:00
[1.7.0] Armor error messages against XSS injection.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1062 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
f7eccc0038
commit
2cbb3be602
@ -170,6 +170,7 @@ class HTMLPurifier_HTMLDefinition
|
||||
$this->processModules();
|
||||
$this->setupConfigStuff();
|
||||
|
||||
// remove complicated variables to ease serialization
|
||||
unset($this->config);
|
||||
unset($this->manager);
|
||||
|
||||
@ -240,6 +241,7 @@ class HTMLPurifier_HTMLDefinition
|
||||
}
|
||||
// emit errors
|
||||
foreach ($allowed_elements as $element => $d) {
|
||||
$element = htmlspecialchars($element);
|
||||
trigger_error("Element '$element' is not supported $support", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
@ -271,6 +273,8 @@ class HTMLPurifier_HTMLDefinition
|
||||
// emit errors
|
||||
foreach ($allowed_attributes_mutable as $elattr => $d) {
|
||||
list($element, $attribute) = explode('.', $elattr);
|
||||
$element = htmlspecialchars($element);
|
||||
$attribute = htmlspecialchars($attribute);
|
||||
if ($element == '*') {
|
||||
trigger_error("Global attribute '$attribute' is not ".
|
||||
"supported in any elements $support",
|
||||
|
Loading…
Reference in New Issue
Block a user