mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-10 07:38:41 +00:00
2c955af135
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
28 lines
538 B
PHP
28 lines
538 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);
|
|
}
|
|
|
|
}
|
|
|