1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-12-14 16:42:59 +01:00
vichan/inc/lib/htmlpurifier-4.5.0/library/HTMLPurifier/AttrDef/HTML/Bool.php
2014-09-23 23:25:04 +00:00

29 lines
588 B
PHP

<?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