Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5786
User.php.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:40 PM
2014-11-21 22:40:17 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
User.php.diff
View Options
Index: includes/User.php
===================================================================
--- includes/User.php (revision 52368)
+++ includes/User.php (working copy)
@@ -614,8 +614,13 @@
return false;
// Password needs to be long enough, and can't be the same as the username
- return strlen( $password ) >= $wgMinimalPasswordLength
- && $wgContLang->lc( $password ) !== $wgContLang->lc( $this->mName );
+ if( strlen( $password ) < $wgMinimalPasswordLength ) {
+ throw new PasswordError( wfMsgExt( 'passwordtooshort', array( 'parsemag' ),
+ $wgMinimalPasswordLength ) );
+ } elseif ( $wgContLang->lc( $password ) === $wgContLang->lc( $this->mName ) ) {
+ throw new PasswordError( wfMsg( 'passwordsameasuser' ) );
+ }
+ return true;
}
/**
@@ -1699,11 +1704,7 @@
throw new PasswordError( wfMsg( 'password-change-forbidden' ) );
}
- if( !$this->isValidPassword( $str ) ) {
- global $wgMinimalPasswordLength;
- throw new PasswordError( wfMsgExt( 'passwordtooshort', array( 'parsemag' ),
- $wgMinimalPasswordLength ) );
- }
+ $this->isValidPassword( $str );
}
if( !$wgAuth->setPassword( $this, $str ) ) {
Index: languages/messages/MessagesEn.php
===================================================================
--- languages/messages/MessagesEn.php (revision 52368)
+++ languages/messages/MessagesEn.php (working copy)
@@ -956,8 +956,9 @@
Please try again.',
'wrongpasswordempty' => 'Password entered was blank.
Please try again.',
-'passwordtooshort' => 'Your password is invalid or too short.
-It must have at least {{PLURAL:$1|1 character|$1 characters}} and be different from your username.',
+'passwordtooshort' => 'Your password is too short.
+It must have at least {{PLURAL:$1|1 character|$1 characters}}.',
+'passwordsameasuser' => 'Your password is invalid. It must be different from your username.',
'mailmypassword' => 'E-mail new password',
'passwordremindertitle' => 'New temporary password for {{SITENAME}}',
'passwordremindertext' => 'Someone (probably you, from IP address $1) requested a new
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5336
Default Alt Text
User.php.diff (2 KB)
Attached To
Mode
T21157: createAndPromote error on bad password
Attached
Detach File
Event Timeline
Log In to Comment