CodeIgniter Forums
'%' = The URI you submitted has disallowed characters-question (again) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: '%' = The URI you submitted has disallowed characters-question (again) (/showthread.php?tid=3527)



'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 10-08-2007

[eluser]codex[/eluser]
Yeah,

I've searched the forum, but I can't seem to find a clear answer as to why '%' is throwing the 'The URI you submitted has disallowed characters.' error. It's in the permitted uri chars.

Anyone an idea?


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 10-08-2007

[eluser]Derek Allard[/eluser]
Is the site live? If not, what does the URL look like? Any htaccess files?


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 10-08-2007

[eluser]codex[/eluser]
It might be because of the htaccess (don't know much about them). Here's what it looks like:

#RewriteEngine on
#RewriteCond $1 !^(index\.php|images|robots\.txt)
#RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

And the URL will accept cat%20dog, but not cat@dog... (%20 = space, @ = @)

Edit: Hmm, if you look at the code above, @should look like % 40 (without space), but it gets converted. Could that be the trouble?


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 10-18-2007

[eluser]bAum[/eluser]
I am having a similar problem. The url in question looks like:

example.com/index.php?/editor/edit/en/11/content/Text_(English)

Permitted URI chars is the default setting:

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


As you can see, I am making sure that the last argument is always treated with urlencode(). Whats bizarre is that by the time CI verifies the URI (Router.php, around line 128), the urlencode stuff has already been decoded. So the url gets ejected not because of the percent sign but because of the "(" evalutating to "(".

So this may be the same problem as you have. The question remains why the urldecoding is automatic, because I didn't call urldecode anywhere yet.


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 10-18-2007

[eluser]bAum[/eluser]
It appears that the important part of my example got screwed up, let me repeat.

The url should read as follows (without the spaces in the last segment):

example.com/index.php?/editor/edit/en/11/content/ T e x t _ % 2 8 English % 2 9


And because "% 2 8" evaluates to "(", the "(" is the reason why the url fails the permitted_uri_chars test, not the percent sign.


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 10-20-2007

[eluser]bAum[/eluser]
Any help would be appreciated..


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 10-21-2007

[eluser]mosba[/eluser]
I am having the same issue. Trying to pass array thru uri. I do st. like
$segment = 'segment/' . urlencode( serialize( $where ) );
and then paste it to the uri so it eventually looks like:
/wrba/show/data/articles/order/id/where/s % 3 A 0 % 3 A % 22 % 22 % 3 B
If I follow this link I get:

"The URI you submitted has disallowed characters."

When I change
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
to
$config['permitted_uri_chars'] = '';
it works but that's not a solution.

It really looks like the CI automatically urldecodes what I have injected there urlencoded. Is there any workaround how get this working with urti chars restricted?

Cheers


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 10-23-2007

[eluser]mosba[/eluser]
base64_encode + allow chars '=|' in permitted_uri_chars in config
or use the AsciiToXex function from:

http://ellislab.com/forums/viewthread/45129/

I have found that thread only now... sorry


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 01-05-2011

[eluser]dbashyal[/eluser]
Has anyone found a better way to fix URI error for referral urls like this one?

http://learntipsandtricks.com/blog/114/85/Alexa-Ranking-Importance-in-Marketing?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed:+learntipsandtricks/SWZj+(Text+Link+Ads+Review)&utm_content=Twitter

Thanks.


'%' = The URI you submitted has disallowed characters-question (again) - El Forum - 03-15-2011

[eluser]richardporteous[/eluser]
assuming
codeigniter 2.0
php is 5.3 and has argv argc registered on
and uri_protocol is auto
doesn't matter if enable_query_strings is true or false (allow_get_array preservers the array so gets works anyway)

either change uri_protocol
OR comment out if this you don't script anywhere.
// // Arguments exist, it must be a command line request
// if ( ! empty($_SERVER['argv']))
// {
// $this->uri_string = $this->_parse_cli_args();
// return;
// }
in _fetch_uri_string in URI.php in system/core

for some reason argv has an array of 23 (but not correct) which contains part of the gets/query string