Welcome Guest, Not a member yet? Register   Sign In
'%' = The URI you submitted has disallowed characters-question (again)


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?

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

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?

I am having a similar problem. The url in question looks like:


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.

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.

Any help would be appreciated..

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~%.:_-';
$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?


base64_encode + allow chars '=|' in permitted_uri_chars in config
or use the AsciiToXex function from:


I have found that thread only now... sorry

Has anyone found a better way to fix URI error for referral urls like this one?



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

Theme © iAndrew 2016 - Forum software by © MyBB