Password not always required on account creation
authorAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 3 Jun 2010 17:31:14 +0000 (17:31 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 3 Jun 2010 17:31:14 +0000 (17:31 +0000)
Bug 23769.  It's not required when the account is being created by
e-mail, regardless of $wgMinimalPasswordLength.  This commit technically
does nothing, given r67283, but it will keep the bug fixed even in the
future when r67283 can be reverted.

includes/User.php

index 941f0bd..aa48403 100644 (file)
@@ -3714,6 +3714,10 @@ class User {
         *
         * Obviously, you still need to do server-side checking.
         *
+        * NOTE: A combination of bugs in various browsers means that this function
+        * actually just returns array() unconditionally at the moment.  May as
+        * well keep it around for when the browser bugs get fixed, though.
+        *
         * @return array Array of HTML attributes suitable for feeding to
         *   Html::element(), directly or indirectly.  (Don't feed to Xml::*()!
         *   That will potentially output invalid XHTML 1.0 Transitional, and will
@@ -3728,7 +3732,14 @@ class User {
 
                # Note that the pattern requirement will always be satisfied if the
                # input is empty, so we need required in all cases.
-               $ret = array( 'required' );
+               #
+               # FIXME (bug 23769): This needs to not claim the password is required
+               # if e-mail confirmation is being used.  Since HTML5 input validation
+               # is b0rked anyway in some browsers, just return nothing.  When it's
+               # re-enabled, fix this code to not output required for e-mail
+               # registration.
+               #$ret = array( 'required' );
+               $ret = array();
 
                # We can't actually do this right now, because Opera 9.6 will print out
                # the entered password visibly in its error message!  When other