0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-14 17:28:40 +00:00
htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
Edward Z. Yang 9c5f01a0cf [1.7.0] Fix bug in Bool class
- Genericize allElements into basic smoketest, add beginnings of legacy smoketest too.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1113 48356398-32a2-884e-a903-53898d9a118a
2007-05-29 02:12:08 +00:00

30 lines
592 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 = false) {$this->name = $name;}
function validate($string, $config, &$context) {
if (empty($string)) return false;
return $this->name;
}
/**
* @param $string Name of attribute
*/
function make($string) {
return new HTMLPurifier_AttrDef_HTML_Bool($string);
}
}
?>