EllisLab text mark
Advanced Search
     
‘%’ = The URI you submitted has disallowed characters-question (again)
Posted: 08 October 2007 12:59 PM
Avatar
Joined: 2007-08-12
414 posts

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?

 
Posted: 08 October 2007 03:11 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-23
3194 posts

Is the site live?  If not, what does the URL look like?  Any htaccess files?

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

 
Posted: 08 October 2007 03:21 PM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-08-12
414 posts

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 dog, but not cat@dog… (  = 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?

 
Posted: 18 October 2007 05:19 AM   [ # 3 ]   [ Rating: 0 ]
Joined: 2007-08-09
20 posts

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.

 
Posted: 18 October 2007 05:23 AM   [ # 4 ]   [ Rating: 0 ]
Joined: 2007-08-09
20 posts

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.

 
Posted: 20 October 2007 12:53 PM   [ # 5 ]   [ Rating: 0 ]
Joined: 2007-08-09
20 posts

Any help would be appreciated..

 
Posted: 21 October 2007 01:49 PM   [ # 6 ]   [ Rating: 0 ]
Joined: 2007-10-04
2 posts

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

 
Posted: 23 October 2007 11:38 AM   [ # 7 ]   [ Rating: 0 ]
Joined: 2007-10-04
2 posts

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

 
Posted: 05 January 2011 06:52 AM   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2008-04-06
142 posts

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.

 Signature 

CodeFight CMS - based on CI 2.0 | Facebook | All CI CMS | twitter | CI | My Website

 
Posted: 16 March 2011 02:45 AM   [ # 9 ]   [ Rating: 0 ]
Joined: 2009-03-28
8 posts

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

 
Posted: 16 March 2011 11:35 PM   [ # 10 ]   [ Rating: 0 ]
Joined: 2009-03-28
8 posts

seems CI 2.01 fixes this exact problem of my post above - nice

 
Posted: 25 October 2012 09:44 AM   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2011-10-29
11 posts

is there any one to sort out this error..as i want to send my data in encrypted format in URL so help me out

 Signature 

Sanju..South D Fire….
.(JavaScript must be enabled to view this email address)