Numbers in URI |
[eluser]JonoB[/eluser]
I have a problem with numbers being included in certain portions of a uri segment. For example, when a number is included after a : (colon), then I get an error. Code: class Foo extends MY_Controller http://localhost/ci/foo/bar/ Code: array http://localhost/ci/foo/bar/test Code: array http://localhost/ci/foo/bar/2 Code: array http://localhost/ci/foo/bar/test:something Code: array http://localhost/ci/foo/bar/test:2 FAIL Code: A PHP Error was encountered http://localhost/ci/foo/bar/2:test Code: array Am I missing something obvious here?
[eluser]Sverri[/eluser]
[quote author="JonoB" date="1300126903"]http://localhost/ci/foo/bar/test:2 FAIL Code: A PHP Error was encountered It seems parse_url() has a problem with the colon in your URI. Try changing line 176 in core/URI.php... Code: $uri = parse_url($uri, PHP_URL_PATH); To this... Code: if (strpos($uri, ':') !== FALSE) You can also, if at all possible, just use / instead of : and then just fetch the number as a segment.
[eluser]Sverri[/eluser]
Okay here is a workaround that should fix it in a minimally invasive manner, provided I am not missing something. Code: // Parse_url will fail on segments that look like "foo:number". It is the |
Welcome Guest, Not a member yet? Register Sign In |