Welcome Guest, Not a member yet? Register   Sign In
Invalid character on Url error
#1

[eluser]Arun Joshi[/eluser]
Hi,

In my site am trying to activate a user when he click on the activation link on his email. In myaddress i have user email address. So the '@' symbol on email address causing the following error. How can I solve this?


An Error Was Encountered
Code:
The URI you submitted has disallowed characters.


Code:
http://mysite.com/activation/[email protected]/01c19622adc2d47749353b7aae785829

I tried urlencode(), but didnt work.

Thanks
Arun
#2

[eluser]mddd[/eluser]
You can set the allowed url characters in config/config.php. If you add the @ to them, it will work like you want to.
Of course, if someone had an email address containing another illegal character you would have the same problem. You could also solve it by not using the email address in the activation link but some other unique id.
#3

[eluser]ELRafael[/eluser]
Do NOT allow @ char!! You can break down your security!

Try do replace the @.
Code:
str_replace('@', 'at', $email)

Or, transform the email into a token, or something else
Code:
$email = md5($email);

Then you can check using this way:
Code:
if ( md5($this->uri->segment(n)) == md5($email) )
{
  echo 'Ok Sam';
}
#4

[eluser]Arun Joshi[/eluser]
Thanks ELRafael,

Great information.




Theme © iAndrew 2016 - Forum software by © MyBB