1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-05 21:57:26 +02:00

[1.3.1] Standardized all attribute handling variables to attr, made it plural

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@600 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-12-06 22:29:08 +00:00
parent cbb492c52c
commit d886ed59fd
13 changed files with 67 additions and 66 deletions

View File

@@ -30,7 +30,7 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy
$token->type == 'start' ) {
$result[] = new HTMLPurifier_Token_Empty($token->name,
$token->attributes);
$token->attr);
continue;
}
@@ -39,7 +39,7 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy
$token->type == 'empty' ) {
$result[] = new HTMLPurifier_Token_Start($token->name,
$token->attributes);
$token->attr);
$result[] = new HTMLPurifier_Token_End($token->name);
continue;

View File

@@ -38,19 +38,19 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy
// hard-coded image special case, pre-emptively drop
// if not available. Probably not abstract-able
if ( $token->name == 'img' ) {
if (!isset($token->attributes['src'])) {
if (!isset($token->attr['src'])) {
continue;
}
if (!isset($definition->info['img']->attr['src'])) {
continue;
}
$token->attributes['src'] =
$token->attr['src'] =
$definition->
info['img']->
attr['src']->
validate($token->attributes['src'],
validate($token->attr['src'],
$config, $context);
if ($token->attributes['src'] === false) continue;
if ($token->attr['src'] === false) continue;
}
} elseif (

View File

@@ -35,7 +35,7 @@ class HTMLPurifier_Strategy_ValidateAttributes extends HTMLPurifier_Strategy
if ($token->type !== 'start' && $token->type !== 'empty') continue;
// copy out attributes for easy manipulation
$attr = $token->attributes;
$attr = $token->attr;
// do global transformations (pre)
// nothing currently utilizes this
@@ -117,7 +117,7 @@ class HTMLPurifier_Strategy_ValidateAttributes extends HTMLPurifier_Strategy
// commit changes
// could interfere with flyweight implementation
$tokens[$key]->attributes = $attr;
$tokens[$key]->attr = $attr;
}
$context->destroy('IDAccumulator');