Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Disallowed Characters with Facebook Connect
#1

[eluser]renownedmedia[/eluser]
Using the Facebook Connect within codeigniter.

Generates a big URL like this one:

Code:
http://domain.com/?fb_sig_in_iframe=1&fb_sig_locale=en_US&fb_sig_in_new_facebook=1&
fb_sig_time=1251233486.7698&fb_sig_added=1&fb_sig_profile_update_time=1250703638&
fb_sig_expires=1251320400&fb_sig_user=207100037&
fb_sig_session_key=2.SaoeJ1qU_CgXZPXx_6mCxw__.86400.1251320400-207100037&
fb_sig_ss=R9sqw2QFBSBQ6wcBRPYmdQ__&fb_sig_ext_perms=auto_publish_recent_activity&
fb_sig_api_key=hash&fb_sig_app_id=123456789&fb_sig=hash

My config.php has the following allowed characters:

Code:
$config['permitted_uri_chars'] = 'a-zA-Z 0-9~%.:_\-\?&=';

And my error is of course as follows:

Code:
An Error Was Encountered

The URI you submitted has disallowed characters.

Tried escaping the characters in every combination with no success. Ran the string above against the long URL using regex buddy and its valid. Anyone got a clue what I'm doing wrong?

EDIT:

Apparently, I forgot to enable the query strings :p

Code:
$config['enable_query_strings'] = TRUE;

Normally, if this is set to false, the URL will still load (and just ignore the GET data) unless the GET values stuck at the end reach a certain string length, then it starts to fail.

EDIT2:

Just an FYI, there is a maximum string length to your GET query before CI goofs up and tells you that it contains disallowed characters, even if you have query strings enabled and all of your characters excused!
#2

[eluser]Mitchell McKenna[/eluser]
wow, this is annoying, has anyone figured out a way around this problem with using Disqus with CodeIgniter?

edit: followed the instructions above and also changed $config['uri_protocol'] to "AUTO" and it facbeook connect with disqus works now on codeigniter.

edit 2: Nevermind, turns out changing the $config['uri_protocol'] to "AUTO" ended up messing up a bunch of places I was passing around a query result, so this doesn't work Sad
#3

[eluser]renownedmedia[/eluser]
I eventually gave up and set up my app as follows:

Canvas Callback URL: http://yourapp.com/entry.php
Connect URL: http://yourapp.com

And my entry.php file contains the following:
Code:
$data = json_encode($_GET);
setcookie("fb_sig", $data, time() + 10, "/");
header("Location: /");

Basically, a user can visit myapp.com and use the application, or it can be embedded using entry.php to grab the evil get data, JSON encode it and stick it into a cookie, which if needed could be JSON decoded and read later in the application. I think I ended up not needing the initial GET data it was sending me at all.




Theme © iAndrew 2016 - Forum software by © MyBB