From 49ebe3c5b7d7948bd30e38be37b2f916aca17828 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Tue, 8 May 2007 00:37:16 +0000 Subject: [PATCH] (bug 9835) password input should be type="password" --- includes/SpecialPreferences.php | 6 +++--- includes/Xml.php | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index a5436d533c..660ede9fda 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -657,15 +657,15 @@ class PreferencesForm { $this->tableRow( Xml::element( 'h2', null, wfMsg( 'changepassword' ) ) ) . $this->tableRow( Xml::label( wfMsg( 'oldpassword' ), 'wpOldpass' ), - Xml::input( 'wpOldpass', 25, $this->mOldpass, array( 'id' => 'wpOldpass' ) ) + Xml::password( 'wpOldpass', 25, $this->mOldpass, array( 'id' => 'wpOldpass' ) ) ) . $this->tableRow( Xml::label( wfMsg( 'newpassword' ), 'wpNewpass' ), - Xml::input( 'wpNewpass', 25, $this->mNewpass, array( 'id' => 'wpNewpass' ) ) + Xml::password( 'wpNewpass', 25, $this->mNewpass, array( 'id' => 'wpNewpass' ) ) ) . $this->tableRow( Xml::label( wfMsg( 'retypenew' ), 'wpRetypePass' ), - Xml::input( 'wpRetypePass', 25, $this->mRetypePass, array( 'id' => 'wpRetypePass' ) ) + Xml::password( 'wpRetypePass', 25, $this->mRetypePass, array( 'id' => 'wpRetypePass' ) ) ) . Xml::tags( 'tr', null, Xml::tags( 'td', array( 'colspan' => '2' ), diff --git a/includes/Xml.php b/includes/Xml.php index 1d38c34e7a..aeb9d5a1e6 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -164,6 +164,14 @@ class Xml { 'value' => $value ) + $attribs ); } + /** + * Convenience function to build an HTML password input field + * @return string HTML + */ + public static function password( $name, $size=false, $value=false, $attribs=array() ) { + return self::input( $name, $size, $value, array_merge($attribs, array('type' => 'password'))); + } + /** * Internal function for use in checkboxes and radio buttons and such. * @return array -- 2.20.1