URI.php _filter_uri preg_match |
|||
|---|---|---|---|
| Date: | 05/13/2008 | Severity: | Trivial |
| Status: | Bogus | Reporter: | zoticaic |
| Version: | 1.6.1 | ||
| Keywords: | Libraries, URI Class | ||
Description
preg_match/preg_escape is not returning matchable pattern casing an index out of bounds error with preg_match.
Code Sample
application/config/config.php:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-+()';
URI:
http://localhost/index.php/videos/Super+Wild(Copy+2)
Expected Result
Expected page should display. Page with video information named ‘Super Wild(Copy 2)’
Actual Result
The URI you submitted has disallowed characters.
Comment on Bug Report
| Posted by: Derek Jones on 13 May 2008 1:53pm | |
|
|
The - needs to be last, and escaped, as it is in the current config.php file. We cannot preg quote the - symbol or the range values will be escaped as well, and will not work. In your instance, you would use:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_+()\-';
|
| Posted by: zoticaic on 13 May 2008 1:55pm | |
|
|
Yeah fogures, doubles escaping the dash ‘-’ solves the problem too. Thanks! |
