Welcome Guest, Not a member yet? Register   Sign In
route bug in _reindex_segments ?
#1

[eluser]Unknown[/eluser]
hello

I have a routing instruction :
Code:
//global redirect
// -any-thing/-begining/-with/-dash/is/cleared => is/cleared
$route['-[^/]*/(?:(?:-[^/]*/)+)?([^\-].*)'] = '$1';

so before call to _reindex_segments, we have
Code:
Router->segments = array('-any-thing', 'home', 'index', 'arg1');
Router->rsegments = array('home', 'index', 'arg1');

but inside, the test
Code:
$diff = (count(array_diff($this->rsegments, $this->segments)) == 0) ? FALSE : TRUE;
returns FALSE

I think it should be replaced with
Code:
$diff = (count(array_diff($this->rsegments, $this->segments)) +
        count(array_diff($this->segments, $this->rsegments)) == 0) ? FALSE : TRUE;
since the value isn't the same when you put segments or rsegments first...


Messages In This Thread
route bug in _reindex_segments ? - by El Forum - 07-18-2007, 02:53 PM
route bug in _reindex_segments ? - by El Forum - 07-18-2007, 03:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB