/plugins/vjCommentPlugin/lib/tools/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
PHP | 28 lines | 14 code | 7 blank | 7 comment | 1 complexity | c579b5a145c447f1880c7bc6d3db774c MD5 | raw file
Possible License(s): LGPL-2.1
- <?php
- /**
- * Validates a boolean attribute
- */
- class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef
- {
- protected $name;
- public $minimized = true;
- public function __construct($name = false) {$this->name = $name;}
- public function validate($string, $config, $context) {
- if (empty($string)) return false;
- return $this->name;
- }
- /**
- * @param $string Name of attribute
- */
- public function make($string) {
- return new HTMLPurifier_AttrDef_HTML_Bool($string);
- }
- }
- // vim: et sw=4 sts=4