dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Avoid using outdated $casToken field for BagOStuff calls"
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki.special.userlogin.signup.js
diff --git
a/resources/src/mediawiki.special.userlogin.signup.js
b/resources/src/mediawiki.special.userlogin.signup.js
index
777f5e9
..
fff2d4e
100644
(file)
--- a/
resources/src/mediawiki.special.userlogin.signup.js
+++ b/
resources/src/mediawiki.special.userlogin.signup.js
@@
-30,7
+30,7
@@
updateForCheckbox();
} );
updateForCheckbox();
} );
- // Check if the username is invalid or already taken
+ // Check if the username is invalid or already taken
; show username normalisation warning
mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
var $usernameInput = $root.find( '#wpName2' ),
$passwordInput = $root.find( '#wpPassword2' ),
mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
var $usernameInput = $root.find( '#wpName2' ),
$passwordInput = $root.find( '#wpPassword2' ),
@@
-43,6
+43,10
@@
// We could just use .then() if we didn't have to pass on .abort()…
var d, apiPromise;
// We could just use .then() if we didn't have to pass on .abort()…
var d, apiPromise;
+ // Leading/trailing/multiple whitespace characters are always stripped in usernames,
+ // this should not require a warning. We do warn about underscores.
+ username = username.replace( / +/g, ' ' ).trim();
+
d = $.Deferred();
apiPromise = api.get( {
action: 'query',
d = $.Deferred();
apiPromise = api.get( {
action: 'query',
@@
-68,6
+72,10
@@
return m.html;
} ) : []
} );
return m.html;
} ) : []
} );
+ } else if ( userinfo.name !== username ) {
+ d.resolve( { valid: true, messages: [
+ mw.message( 'createacct-normalization', username, userinfo.name ).parseDom()
+ ] } );
} else {
d.resolve( { valid: true, messages: [] } );
}
} else {
d.resolve( { valid: true, messages: [] } );
}