Fix bug in whitelist checking, fix #96

Because we used indexOf to check if a user is on the whitelist, users
whose usernames are substrings of usernames already on the list are
also allowed.
This commit is contained in:
Daniel Glus 2018-07-09 23:11:01 -04:00
parent 837efdb386
commit 2a8780369d

View File

@ -102,7 +102,7 @@
whitelist = new AFCH.Page( AFCH.consts.whitelistTitle );
whitelist.getText().done( function ( text ) {
var $howToDisable,
userAllowed = text.indexOf( user ) !== -1;
userAllowed = ( new RegExp( '\|\s*' + user + '\s*}' ).test( text );
if ( !userAllowed ) {