wrong parameters when rerouting |
|||
|---|---|---|---|
| Date: | 08/08/2007 | Severity: | Minor |
| Status: | Duplicate | Reporter: | mo26 |
| Version: | 1.5.3 | ||
| Keywords: | |||
Description
When using routing and the url has got a different length, then parameters to controllers are not passed correctly
Code Sample
in routes.php
$route['controller/(.*)'] = "$1";
in controllers/admin.php
class admin extends Controller {
function admin()
{
parent::Controller();
}
function edit($ID)
{
echo $ID;
}
}
then on url http://controller/admin/edit/1
Expected Result
1
Actual Result
edit
Comment on Bug Report
| Posted by: Seppo on 16 January 2008 9:59pm | |
|
|
I think it gets fixed replacing for |
| Posted by: Derek Jones on 30 January 2008 1:32am | |
|
|
Indeed, this is fixed by way of the fix for this bug, though the fix that went in the code omits count()ing the returned arrays.
$diff = (array_diff($this->rsegments, $this->segments) != array_diff($this->segments, $this->rsegments)) ? TRUE : FALSE;
I don’t anticipate this causing any problems, as it should never evaluate as TRUE unless one of the arrays contains a key that the other doesn’t, regardless of the order of the values in the original arrays. |
