CodeIgniter Forums
Accept symbols on URL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Accept symbols on URL (/thread-31229.html)



Accept symbols on URL - El Forum - 06-10-2010

[eluser]Kevin_3_57[/eluser]
Hi people, I'm having trouble with allowing some symbols on the url in Ci. As i'm using Facebook PHP Api, I get some symbols on the URL due to the crossdomain receiver. Anyway, the only thing I want is to be able to put characters as { } ? : | " , & on the url, so I modified:
Code:
$config['permitted_uri_chars'] = '';
and leave it to blank like the example above and didn't work, I still get the Disallowed Key Characters error.

So, I tried with this:
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.,&:?{}|=_\-';

But that didn't work either.

So, CI guru's, any idea?

Thanks in advance!,
Kevin.


Accept symbols on URL - El Forum - 06-16-2010

[eluser]Ener1[/eluser]
Hey kevin, did you put your $config[‘enable_query_strings’] in TRUE?

and remember to use \ to escape for example ?


Hope it helps


Accept symbols on URL - El Forum - 06-16-2010

[eluser]Kevin_3_57[/eluser]
Yes, query strings are enabled, I'm sure the problem is with { } symbols.
I'm thinking about not using CI for this project cause I can't find a solution Sad

Only "?" or there are other symbols in a-z 0-9~%.,&:?{}|=_\- which needs to be escaped?

Thanks very much!


Accept symbols on URL - El Forum - 06-16-2010

[eluser]Ener1[/eluser]
one more, did you read this? http://junal.wordpress.com/2008/01/20/a-sample-facebook-application-with-codeigniter/

and this http://www.volkanrivera.com/esp/?p=972

I think you may find some really good examples to go over this problem

Once again I hope it helps


Accept symbols on URL - El Forum - 06-16-2010

[eluser]Kevin_3_57[/eluser]
Yeah! I've already read those pages, the problem is that both work with an Iframe application inside facebook which mine doesn't.

The string that Facebook returns once the user logs in is similar to this:

http://mysite.com/index.php?session={"session_key":"2.8mtVdtZ7JBcHRIs7HeyJrg__.3600.12761101000-100000005993065",
"uid":"100000005993165","expires":1276110000,"secret":
"lX1a3ANmg1123QFcgWol_sYgw__","access_token":"102508123939795158|2.8mtVdtZ7JBcHRIs7HeyJrg__.3600.1276110000-
100000005993065|oNsokAurI82jPBJ8loGZv57xBDc.","sig":"6ff986b07jhgc5d5bfa41e139d80513cdaa"}&rsvp;_event,email


Thanks!

(Edited so it fits screen)


Accept symbols on URL - El Forum - 06-16-2010

[eluser]Ener1[/eluser]
One more chance try

$config['uri_protocol'] = 'QUERY_STRING';

and add the {} scaped like \{ \}


Accept symbols on URL - El Forum - 06-16-2010

[eluser]Ener1[/eluser]
and are you urlencoding the facebook devolution ?


Accept symbols on URL - El Forum - 06-16-2010

[eluser]Kevin_3_57[/eluser]
With $config[‘uri_protocol’] = ‘QUERY_STRING’; the page just throws "The URI you submitted has disallowed characters".

Sad No luck with that either.

Thanks for taking the time, seriously. Thanks!


Accept symbols on URL - El Forum - 06-16-2010

[eluser]Ener1[/eluser]
Sorry I couldn´t help you more
the fact is that this characters are reserved in regex { } ? : | and must be escaped some way

I find this in other post, you loose nothing trying Wink

" Also note that if you want to escape a \ (backslash) you need to put four backslashes in your permitted_uri_chars parameter like this:

$config[‘permitted_uri_chars’] = ‘a-z\s0-9~%.:_\-\’\\\\’; "

And no problem, the greatest thing about this community is that maybe other day you take the time to do the same for others, and other day I can be the other Wink