You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing an invalid named route to redirect() causes a type error:
SYSTEMPATH/Router/RouteCollection.php at line 1117
ltrim() expects parameter 1 to be string, object given
...
1115 // Lose any namespace slash at beginning of strings
1116 // to ensure more consistent match.
1117 $to = ltrim($to, '\\');
This should be throwing something helpful, like HTTPException::forInvalidRedirectRoute. Tested with and without custom route definitions.
PHP: 7.2.16
CodeIgniter: 4.0.0-beta.2
The text was updated successfully, but these errors were encountered:
It seems to be choking on Closures, trying to use ltrim() on them. Since this section is explicitly looking for a string match to $search I think it would be find to skip anything else:
foreach ($collection as $route)
{
$from = key($route['route']);
$to = $route['route'][$from];
if (! is_string($to))
{
continue;
}
...
MGatner
added a commit
to MGatner/CodeIgniter4
that referenced
this issue
Apr 21, 2019
Passing an invalid named route to
redirect()
causes a type error:This should be throwing something helpful, like
HTTPException::forInvalidRedirectRoute
. Tested with and without custom route definitions.The text was updated successfully, but these errors were encountered: