mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-30 19:00:10 +02:00
Implement simple attribute transformations and roll them out.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@152 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -36,10 +36,17 @@ class HTMLPurifier_Strategy_ValidateAttributes extends HTMLPurifier_Strategy
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
if (!$result) {
|
||||
if ($result === false) {
|
||||
$changed = true;
|
||||
unset($attr[$attr_key]);
|
||||
} elseif (is_string($result)) {
|
||||
// simple substitution
|
||||
$changed = true;
|
||||
$attr[$attr_key] = $result;
|
||||
}
|
||||
// we'd also want slightly more complicated substitution,
|
||||
// although we're not sure how colliding attributes would
|
||||
// resolve
|
||||
}
|
||||
if ($changed) {
|
||||
$tokens[$key]->attributes = $attr;
|
||||
|
Reference in New Issue
Block a user