CodeIgniter Forums

Full Version: '%' = The URI you submitted has disallowed characters-question (again)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum


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?

El Forum

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

El Forum

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?

El Forum

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.

El Forum

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): 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.

El Forum

Any help would be appreciated..

El Forum

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?


El Forum

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

I have found that thread only now... sorry

El Forum

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


El Forum

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
Pages: 1 2