route bug in _reindex_segments ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: route bug in _reindex_segments ? (/showthread.php?tid=2150) |
route bug in _reindex_segments ? - El Forum - 07-18-2007 [eluser]Unknown[/eluser] hello I have a routing instruction : Code: //global redirect so before call to _reindex_segments, we have Code: Router->segments = array('-any-thing', 'home', 'index', 'arg1'); but inside, the test Code: $diff = (count(array_diff($this->rsegments, $this->segments)) == 0) ? FALSE : TRUE; I think it should be replaced with Code: $diff = (count(array_diff($this->rsegments, $this->segments)) + route bug in _reindex_segments ? - El Forum - 07-18-2007 [eluser]Unknown[/eluser] In case you do so, add this code to the end of the _validate_segments function: Code: if($this->fetch_directory()!='') it will prevent bugs apearing when your controller is inside a subfolder, since now rsegment[1] would, without it, not be the name of the folder... |