(bug 9835) password input should be type="password"
authorRiver Tarnell <river@users.mediawiki.org>
Tue, 8 May 2007 00:37:16 +0000 (00:37 +0000)
committerRiver Tarnell <river@users.mediawiki.org>
Tue, 8 May 2007 00:37:16 +0000 (00:37 +0000)
includes/SpecialPreferences.php
includes/Xml.php

index a5436d5..660ede9 100644 (file)
@@ -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' ),
index 1d38c34..aeb9d5a 100644 (file)
@@ -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