summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/AttrDef/HTML/Bool.php
blob: 93a43d0e4320ac8cd73036c71bc968f56b5c9ab1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?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