1<?php
2/**
3 * Class for <input type="password" /> elements
4 *
5 * PHP version 5
6 *
7 * LICENSE
8 *
9 * This source file is subject to BSD 3-Clause License that is bundled
10 * with this package in the file LICENSE and available at the URL
11 * https://raw.githubusercontent.com/pear/HTML_QuickForm2/trunk/docs/LICENSE
12 *
13 * @category  HTML
14 * @package   HTML_QuickForm2
15 * @author    Alexey Borzov <avb@php.net>
16 * @author    Bertrand Mansion <golgote@mamasam.com>
17 * @copyright 2006-2021 Alexey Borzov <avb@php.net>, Bertrand Mansion <golgote@mamasam.com>
18 * @license   https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
19 * @link      https://pear.php.net/package/HTML_QuickForm2
20 */
21
22/**
23 * Base class for <input> elements
24 */
25require_once 'HTML/QuickForm2/Element/Input.php';
26
27/**
28 * Class for <input type="password" /> elements
29 *
30 * @category HTML
31 * @package  HTML_QuickForm2
32 * @author   Alexey Borzov <avb@php.net>
33 * @author   Bertrand Mansion <golgote@mamasam.com>
34 * @license  https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
35 * @version  Release: 2.2.2
36 * @link     https://pear.php.net/package/HTML_QuickForm2
37 */
38class HTML_QuickForm2_Element_InputPassword extends HTML_QuickForm2_Element_Input
39{
40    protected $persistent = true;
41
42    protected $attributes = ['type' => 'password'];
43
44    protected function getFrozenHtml()
45    {
46        $value = $this->getValue();
47        return (('' != $value)? '********': '&nbsp;') .
48               $this->getPersistentContent();
49    }
50}
51?>