To trim or not to trim / ? That's the question (CI_URI) |
[eluser]dirkpostma[/eluser]
I found out that the URI detection in CI_URI has gone through a major rewrite in CI 2.0.0 and that the behaviour has change. My code is partially broken because of that. I also found the cause. In CI 2.0.0 slashes are are trimmed in line 179 of CI_URI.php Code: return str_replace(array('//', '../'), '/', trim($uri, '/')); This means that the behaviour has changed, as in CI 1.7.2 this trimming is not executed. The manual says: Quote:$this->uri->uri_string() ..but because of the trimming of slashes, this is not the case anymore. The result will be: Quote:news/local/345 I want to adapt my code for the future, but I don't know what the behaviour should be. The behaviour according according to the current code or acoording to the manual? In other words, what will the future be? To trim or not trim /'s?
[eluser]dirkpostma[/eluser]
This fix works for me: Code: <?php NB: Save this code in {your_application_path}/core/MY_URI.php (NOT in {your_application_path}/libraries didn't work for me) |
Welcome Guest, Not a member yet? Register Sign In |