r41787 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41786‎ | r41787 | r41788 >
Date:23:57, 6 October 2008
Author:aaron
Status:old (Comments)
Tags:
Comment:
(bug 10250) New password submission oddness for empty passwords
Modified paths:
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -135,7 +135,7 @@
136136 global $wgAuth, $wgEmailConfirmToEdit;
137137
138138
139 - if ( '' != $this->mNewpass && $wgAuth->allowPasswordChange() ) {
 139+ if ( ($this->mNewpass !== '' || $this->mOldpass !== '' ) && $wgAuth->allowPasswordChange() ) {
140140 if ( $this->mNewpass != $this->mRetypePass ) {
141141 wfRunHooks( 'PrefsPasswordAudit', array( $wgUser, $this->mNewpass, 'badretype' ) );
142142 $this->mainPrefsForm( 'error', wfMsg( 'badretype' ) );

Comments

#Comment by Brion VIBBER (talk | contribs)   00:18, 13 October 2008

This allows you to change from a non-empty password to an empty password (eg, if you fill in the 'old password' field). Previously that was broken by simply failing to recognize it.

Of course zero-length passwords are unwise to begin with. :)

Status & tagging log