ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_Strategy_ValidateAttributes Class Reference

Validate all attributes in the tokens. More...

+ Inheritance diagram for HTMLPurifier_Strategy_ValidateAttributes:
+ Collaboration diagram for HTMLPurifier_Strategy_ValidateAttributes:

Public Member Functions

 execute ($tokens, $config, $context)

Detailed Description

Validate all attributes in the tokens.

Definition at line 7 of file ValidateAttributes.php.

Member Function Documentation

HTMLPurifier_Strategy_ValidateAttributes::execute (   $tokens,
  $config,
  $context 
)
Parameters
HTMLPurifier_Token[]$tokens
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Returns
HTMLPurifier_Token[]

Reimplemented from HTMLPurifier_Strategy.

Definition at line 16 of file ValidateAttributes.php.

{
// setup validator
$validator = new HTMLPurifier_AttrValidator();
$token = false;
$context->register('CurrentToken', $token);
foreach ($tokens as $key => $token) {
// only process tokens that have attributes,
// namely start and empty tags
if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty) {
continue;
}
// skip tokens that are armored
if (!empty($token->armor['ValidateAttributes'])) {
continue;
}
// note that we have no facilities here for removing tokens
$validator->validateToken($token, $config, $context);
}
$context->destroy('CurrentToken');
return $tokens;
}

The documentation for this class was generated from the following file: