Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

%40 on click turns to %2540

Tags:

php

yii

when the link is clicked containing the @ symbol, the url gives me %40, which is what I want. But once I click it, one second later it changes to %2540 right after I click. The click is within an email, then directed to the site, where %40 changes to %2540. How can I make it stop changing?

it is getting the params like this now:

$email=Yii::app()->request->getParam('email');

not sure what other information i should provide.

like image 283
hammies Avatar asked Aug 19 '14 21:08

hammies


2 Answers

The issue is that your %40 is url-encoded again (since % encodes to %25), which gives you %2540.

like image 172
jh314 Avatar answered Oct 20 '22 00:10

jh314


There's not enough detail in your question to work out exactly why, but I can tell you at least what it is that's going on, and that should give you some clues.

A "@" has an ASCII code of hex 40, so when it gets escaped (i.e., turned into something without any special characters in it), it becomes "%40". But a "%" has an ASCII code of hex 25. If you escape a "%", you get "%25".

Your text is getting escaped twice: first to go from "@" to "%40", and then again to go from "%40" to "%2540".

like image 23
chiastic-security Avatar answered Oct 19 '22 23:10

chiastic-security