After we set up friendly url, the link we got when we registered was not working.
we got a
Error Code: 500 Internal Server Error. Friendly url off worked fine.
we thought that it had to do with the .htaccess.
// htaccess code
RewriteEngine On
RewriteBase /
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NE]
the link we have is "?lp=NjE5cWpyMm4%253D&lu=bWFydHluMg%253D%253D"
we saw that the url is encoded 2 times. Becauce %253D should be =
But the translation the first time "%3D" is "=" which is correct, but after the second loop it took "%3D" and translated the "%" into "%253D" because "%25" is equal to "%"
after we had remove d 1 encode and decode from the login code it worked .
//code from core/components/login/processors/register.php
change on line 122 and 123
$confirmParams['lp'] = urlencode(base64_encode($pword));
$confirmParams['lu'] = urlencode(base64_encode($user->get('username')));
to
$confirmParams['lp'] = base64_encode($pword);
$confirmParams['lu'] = base64_encode($user->get('username'));
//code from snippet ConfirmRegister
change on line 45 and 46
$username = base64_decode(urldecode(rawurldecode($_REQUEST['lu'])));
$password = base64_decode(urldecode(rawurldecode($_REQUEST['lp'])));
to
$username = base64_decode(rawurldecode($_REQUEST['lu']));
$password = base64_decode(rawurldecode($_REQUEST['lp']));
the url is now "?lp=NjE5cWpyMm4%3D&lu=bWFydHluMg%3D%3D"
this link is working with friendly url