ILIAS  Release_4_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)
 Executes the strategy on the tokens.

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 
)

Executes the strategy on the tokens.

Parameters
$tokensArray of HTMLPurifier_Token objects to be operated on.
$configConfiguration options
Returns
Processed array of token objects.

Reimplemented from HTMLPurifier_Strategy.

Definition at line 10 of file ValidateAttributes.php.

References $config, and $key.

{
// 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);
$tokens[$key] = $token; // for PHP 4
}
$context->destroy('CurrentToken');
return $tokens;
}

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