Are URI/URLs escaped in CI when used like so?
function foo($url_arg)
$this->input->get('foo');
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your example contains 2 different types of inputs – a URI segment (the argument passed to
foo()) and a GET array item namedfoo.The URI class contains a private method called
_filter_urithat, as you may have guessed, takes care of filtering the URI. First, it will check the$config['permitted_uri_chars']item located inconfig.phpand remove any character not defined there. Regardless of what is defined there, however, it will also do the following:Check out the URI class source for more information.
Regarding the GET array item, if
$config['allow_get_array'](again, located inconfig.php) is set toFALSE, the GET array will be completely destroyed.$this->input->get('foo'), by default, permits “only alpha-numeric (and a few other) characters”. If a 2nd paramater ofTRUEis included, CodeIgniter will run the value(s) through its XSS filter.