ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
HTMLPurifier_AttrTransform_Input Class Reference

Performs miscellaneous cross attribute validation and filtering for input elements. More...

+ Inheritance diagram for HTMLPurifier_AttrTransform_Input:
+ Collaboration diagram for HTMLPurifier_AttrTransform_Input:

Public Member Functions

 __construct ()
 
 transform ($attr, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_AttrTransform
 transform ($attr, $config, $context)
 Abstract: makes changes to the attributes dependent on multiple values. More...
 
 prependCSS (&$attr, $css)
 Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist. More...
 
 confiscateAttr (&$attr, $key)
 Retrieves and removes an attribute. More...
 

Protected Attributes

 $pixels
 

Detailed Description

Performs miscellaneous cross attribute validation and filtering for input elements.

This is meant to be a post-transform.

Definition at line 7 of file Input.php.

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_AttrTransform_Input::__construct ( )

Definition at line 11 of file Input.php.

11  {
12  $this->pixels = new HTMLPurifier_AttrDef_HTML_Pixels();
13  }
Validates an integer representation of pixels according to the HTML spec.
Definition: Pixels.php:6

Member Function Documentation

◆ transform()

HTMLPurifier_AttrTransform_Input::transform (   $attr,
  $config,
  $context 
)

Definition at line 15 of file Input.php.

References $result, and $t.

15  {
16  if (!isset($attr['type'])) $t = 'text';
17  else $t = strtolower($attr['type']);
18  if (isset($attr['checked']) && $t !== 'radio' && $t !== 'checkbox') {
19  unset($attr['checked']);
20  }
21  if (isset($attr['maxlength']) && $t !== 'text' && $t !== 'password') {
22  unset($attr['maxlength']);
23  }
24  if (isset($attr['size']) && $t !== 'text' && $t !== 'password') {
25  $result = $this->pixels->validate($attr['size'], $config, $context);
26  if ($result === false) unset($attr['size']);
27  else $attr['size'] = $result;
28  }
29  if (isset($attr['src']) && $t !== 'image') {
30  unset($attr['src']);
31  }
32  if (!isset($attr['value']) && ($t === 'radio' || $t === 'checkbox')) {
33  $attr['value'] = '';
34  }
35  return $attr;
36  }
$result

Field Documentation

◆ $pixels

HTMLPurifier_AttrTransform_Input::$pixels
protected

Definition at line 9 of file Input.php.


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