Welcome Guest, Not a member yet? Register   Sign In
Allowing '@' character in URL
#1

[eluser]Unknown[/eluser]
Ive search around the forums and Google to try and find an answer but cant seem to find out why its not working. I want to allow the '@' character in my URL strings, but when I add it to the permitted characters config and still get "The URI you submitted has disallowed characters.". Heres my current permitted URL config:

Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:?@=_\-';
#2

[eluser]theprodigy[/eluser]
the '@' is a reserved character for URL syntax. It has special meaning. So in order to use it, you need to use the urlencode() method prior to redirecting. On the receiving end, you will need to use the urldecode() method the get the data back into the format you need.
#3

[eluser]tkam[/eluser]
Hi!

I am having a similar problem with an url encoded @.

CI says this url is invalid:
http://localhost:8888/xxx/client/newpassword/tomka% 40web.de <- no space in there, but the forum changes it to an @ otherwise

When I insert the @ to the config line like this:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-@';

it does work. But I don't want to allow the @ in the url, that's why I use urlencode.

I tried to turn off modrewrite, but the problem remains.

Is there a problem with MAMP?

Cheers
Tom
#4

[eluser]Mareshal[/eluser]
[quote author="theprodigy" date="1265783746"]the '@' is a reserved character for URL syntax. It has special meaning. So in order to use it, you need to use the urlencode() method prior to redirecting. On the receiving end, you will need to use the urldecode() method the get the data back into the format you need.[/quote]

@ is not a reserved char. I use it instead of page.html => page@html

So it works
#5

[eluser]foyer[/eluser]
[quote author="tkam" date="1268950873"]Hi!

I am having a similar problem with an url encoded @.

CI says this url is invalid:
http://localhost:8888/xxx/client/newpassword/tomka% 40web.de <- no space in there, but the forum changes it to an @ otherwise

When I insert the @ to the config line like this:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-@';

it does work. But I don't want to allow the @ in the url, that's why I use urlencode.

I tried to turn off modrewrite, but the problem remains.

Is there a problem with MAMP?

Cheers
Tom[/quote]

You probably need to use urldecode() in your PHP code
#6

[eluser]tkam[/eluser]
And how would that help me?

The urlencoded string is part of the uri, so it is already encoded and should not throw an error like 'disallowed characters'.

Sure, I need to urldecode the string again, when I want to use it, but I don't get to that part of my app because of the described error.

Maybe I misunderstand the permitted_uri_chars concept?

The original line: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

should allow urlencoded characters like % 40 (without space). Or am I wrong here?
#7

[eluser]foyer[/eluser]
Your right, actually I am having the same problem with the % character Tongue
#8

[eluser]tkam[/eluser]
Does no one know a workaround or solution for this? For now I have used base64 encoding, which seems to work properly. Anyway it would be nice to be able to use urlencoding.




Theme © iAndrew 2016 - Forum software by © MyBB