Warning: The author of this contribution does not provide support for it anymore.

Breizh Ajax Checks

Fix: Plus sign encoding issue. - Breizh Ajax Checks

Fix: Plus sign encoding issue.

by PiperB » Mon Nov 26, 2018 8:04 am

With the way the code is currently, it does not allow for the reading of plus signs within passwords or otherwise. Here the js needs to be encoded in order for any of the replacements as such to work.

Without this encoding, for example if your members have a plus sign or other character that js replaces with a space (a.k.a. %20) by default, upon entering the 'current password' into the form, it will tell them "The current password you entered is incorrect.". Just try using a plus sign in your password and see for yourself.

Open: styles/yourstyle/template/ajax_checks.js

Find: (This part currently will not work without the encoding)

Code: Select all

// Little magic to prevent bug with somes caracters
function replaceValue(value){
	value = value.replace(/&/g,'%26').replace(/&/g,'%26');
	return value;
}
Replace with: (Here we have added the encoding, as well as the replacement for the plus sign '+')

Code: Select all

// Little magic to prevent bug with somes caracters
function replaceValue(value){
	value = encodeURIComponent(value);
	value = value.replace(/&/g,'%26').replace(/&/g,'%26').replace(/\+/g,'%2B');
	return value;
}
Save the file, refresh your templates and clear the cache.

Now you and your members can use plus signs and & characters or other characters in their passwords and what not. :)

This fix will work for the extension version as well. Just apply the fix in the same find within the template js file.
<!-- IF U_LOVE_NOTEPAD++ -->
[td class=statement]I Notepad++ ![/td]
<!-- ENDNEVER --> <!-- tee hee --> :P
Whoa ooo whoa ooo whoa I'm a Lady!
User avatar
PiperB
Registered User
Posts: 173
Joined: Mon Nov 07, 2016 6:54 pm
Contact: