return null;
}
+ public function isPersistent() {
+ if ( isset( $this->mParams['persistent'] ) ) {
+ return $this->mParams['persistent'];
+ }
+ // don't put passwords into the HTML body, they could get cached or otherwise leaked
+ return !( isset( $this->mParams['type'] ) && $this->mParams['type'] === 'password' );
+ }
+
function getInputHTML( $value ) {
+ if ( !$this->isPersistent() ) {
+ $value = '';
+ }
+
$attribs = [
'id' => $this->mID,
'name' => $this->mName,
}
function getInputOOUI( $value ) {
+ if ( !$this->isPersistent() ) {
+ $value = '';
+ }
+
$attribs = $this->getTooltipAndAccessKey();
if ( $this->mClass !== '' ) {
'type',
];
- $attribs += $this->getAttributes( $allowedParams, [
- 'maxlength' => 'maxLength',
- 'readonly' => 'readOnly',
- 'tabindex' => 'tabIndex',
- ] );
+ $attribs += OOUI\Element::configFromHtmlAttributes(
+ $this->getAttributes( $allowedParams )
+ );
$type = $this->getType( $attribs );