JoJo
JoJo

Reputation: 20115

How do you allow URI encoded characters in CodeIgniter URLs?

I am using CodeIgniter 1.7.1. My permitted URI characters are set as such:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_()@&\-';

When I type a address like http://website.com/index.php/controller/method/test%21, the page does not load and gives me the error:

Code igniter: An Error Was EncounteredThe URI you submitted has disallowed characters.

I don't understand. %20 (space) is allowed, but %21 (exclamation mark) is not.

Upvotes: 5

Views: 20448

Answers (2)

Syed Ahmed
Syed Ahmed

Reputation: 1645

%21 parse into ! in codeigniter. So codeigniter doesn't support this please ! into permitted uri config file:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_()@&\-!';

Upvotes: 6

Derek Wasswa
Derek Wasswa

Reputation: 11

try escaping it with this, that should work

\\+

Upvotes: -1

Related Questions