Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / AttrDef / HTML / Bool.php
blobff6f0a8649c6a82c0456a268e4c5d8610c1974be
1 <?php
3 require_once 'HTMLPurifier/AttrDef.php';
5 /**
6 * Validates a boolean attribute
7 */
8 class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef
11 var $name;
12 var $minimized = true;
14 function HTMLPurifier_AttrDef_HTML_Bool($name = false) {$this->name = $name;}
16 function validate($string, $config, &$context) {
17 if (empty($string)) return false;
18 return $this->name;
21 /**
22 * @param $string Name of attribute
24 function make($string) {
25 return new HTMLPurifier_AttrDef_HTML_Bool($string);