All values, including empty, are valid HTML bools.
[htmlpurifier.git] / library / HTMLPurifier / AttrDef / HTML / Bool.php
blobdea15d2cd21cf5ad3c0e0b1877ba89a6bf367cfe
1 <?php
3 /**
4 * Validates a boolean attribute
5 */
6 class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef
9 /**
10 * @type bool
12 protected $name;
14 /**
15 * @type bool
17 public $minimized = true;
19 /**
20 * @param bool $name
22 public function __construct($name = false)
24 $this->name = $name;
27 /**
28 * @param string $string
29 * @param HTMLPurifier_Config $config
30 * @param HTMLPurifier_Context $context
31 * @return bool|string
33 public function validate($string, $config, $context)
35 return $this->name;
38 /**
39 * @param string $string Name of attribute
40 * @return HTMLPurifier_AttrDef_HTML_Bool
42 public function make($string)
44 return new HTMLPurifier_AttrDef_HTML_Bool($string);
48 // vim: et sw=4 sts=4