mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-13 00:38:42 +00:00
a7fab00cdd
- Update TODO list - URISchemeRegistry doesn't return a reference for instance anymore, should do the same for other singletons git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1477 48356398-32a2-884e-a903-53898d9a118a
30 lines
600 B
PHP
30 lines
600 B
PHP
<?php
|
|
|
|
require_once 'HTMLPurifier/AttrDef.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);
|
|
}
|
|
|
|
}
|
|
|