mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 08:51:53 +00:00
23 lines
422 B
PHP
23 lines
422 B
PHP
|
<?php
|
||
|
|
||
|
require_once 'HTMLPurifier/AttrDef.php';
|
||
|
|
||
|
/**
|
||
|
* Validates a boolean attribute
|
||
|
*/
|
||
|
class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef
|
||
|
{
|
||
|
|
||
|
var $name;
|
||
|
var $minimized = true;
|
||
|
|
||
|
function HTMLPurifier_AttrDef_HTML_Bool($name) {$this->name = $name;}
|
||
|
|
||
|
function validate($string, $config, &$context) {
|
||
|
if (empty($string)) return false;
|
||
|
return $name;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
?>
|