ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules 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)
 
- Public Member Functions inherited from HTMLPurifier_Strategy
 execute ($tokens, $config, $context)
 Executes the strategy on the tokens. More...
 

Detailed Description

Validate all attributes in the tokens.

Definition at line 7 of file ValidateAttributes.php.

Member Function Documentation

◆ execute()

HTMLPurifier_Strategy_ValidateAttributes::execute (   $tokens,
  $config,
  $context 
)

Definition at line 10 of file ValidateAttributes.php.

10  {
11 
12  // setup validator
13  $validator = new HTMLPurifier_AttrValidator();
14 
15  $token = false;
16  $context->register('CurrentToken', $token);
17 
18  foreach ($tokens as $key => $token) {
19 
20  // only process tokens that have attributes,
21  // namely start and empty tags
22  if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty) continue;
23 
24  // skip tokens that are armored
25  if (!empty($token->armor['ValidateAttributes'])) continue;
26 
27  // note that we have no facilities here for removing tokens
28  $validator->validateToken($token, $config, $context);
29 
30  $tokens[$key] = $token; // for PHP 4
31  }
32  $context->destroy('CurrentToken');
33 
34  return $tokens;
35  }
Validates the attributes of a token.
Concrete start token class.
Definition: Start.php:6
Concrete empty token class.
Definition: Empty.php:6

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