Reputation:
I am sending an activation email to my users that looks like this:
Please, click here in order to validate your email address and complete the activation
of your account.
Where the words "click here" have a link to this URL:
https://example.com/users/[email protected]®id=APA91bGSRWxbsClcN9-SY
It works well in most cases, but one costumer that opens the link with the Android browsers below automatically transforms the URL to https://example.com/users/activate?username=myemail<span>@</span>example.com®id=APA91bGSRWxbsClrN9-SY
From my app log I receive a request for https://example.com/users/activate?username=myemail%3Cspan%3E@%3C/span%3E...
which causes the app to break.
How can I prevent this?
BROWSER CONF:
“Agent:Mozilla/5.0 (Linux; Android 4.4.2; HUAWEI P6 S-U06 Build/HuaweiP6S-U06) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36”
Upvotes: 0
Views: 58
Reputation: 327
Check this tutorial on HTML URL Encoding. The URL Encode for the symbol "@" is "%40" so use:
https://example.com/users/activate?username=myemail%40example.com®id=APA91bGSRWxbsClcN9-SY
Upvotes: 0
Reputation:
Fixed by replacing the symbol "@" in the URL by the equivalent encoding "%40".
Upvotes: 1