XAMPP Version: 1.8.1
codeigniter 2.1.3
Error reported after setting up web hosting: The URI you submitted has disallowed characters
It is said that change $config[‘permitted_uri_chars’] = ‘a-z 0-9~%.:_-‘; to
$config['permitted_uri_chars'] = 'a-z 0-9~%\.\:_\-';
But I didn’t find any effect after I changed it. What works is the following function.
CI_ Just change the URI
function _filter_uri($str)
{
if ($str != '' AND $this->config->item('permitted_uri_chars') != '')
{
$str = urlencode($str); if ( ! preg_match("|^[".($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str))) {
exit('The URI you submitted has disallowed characters.');
}
$str = urldecode($str);
}
return $str;
}
It seems that this problem has something to do with xampp
The specific reason is not very clear, with time to study
Similar Posts:
- What happened to CodeIgniter disallowed key characters?
- Python 3: URLEncode and urlcode
- [LeetCode] 291. Word Pattern II
- PHP: How to Solve Laravel rules preg_match(): No ending delimiter ‘/’ found
- [Solved] Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors wi…
- Script error: unary operator expected [How to Solve]
- [Solved] Git conflict Error: commit your changes or stash them before you can merge
- Please, commit your changes or stash them before you can merge
- A solution to xampp Apache’s failure to start
- Xampp modify the port number Apache service detected with wrong [How to Solve]