mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 03:10:09 +02:00
Fix case-sensitivity issues for attributes. Added TokenTest. Updated TODO. Removed TagTransform::normalizeAttributes
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@142 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -52,6 +52,16 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token // abstract
|
||||
*/
|
||||
function HTMLPurifier_Token_Tag($name, $attributes = array()) {
|
||||
$this->name = ctype_lower($name) ? $name : strtolower($name);
|
||||
foreach ($attributes as $key => $value) {
|
||||
// normalization only necessary when key is not lowercase
|
||||
if (!ctype_lower($key)) {
|
||||
$new_key = strtolower($key);
|
||||
if (!isset($attributes[$new_key])) {
|
||||
$attributes[$new_key] = $attributes[$key];
|
||||
}
|
||||
unset($attributes[$key]);
|
||||
}
|
||||
}
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user