Closed
Description
- Laravel Version: 5.5
- PHP Version: 7.2
Description:
Passing an encoded forward slash as a route parameter will be interpreted by the router as a decoded forward slash.
Steps To Reproduce:
Example Code:
Route::get('search/{search}/{params?}', 'SearchController@searchItems')
->where('params', '.*');
class SearchController extends Controller
{
public function searchItems(string $search, string $params = null)
{
dd($search);
}
}
Using the route:
/api/search/10%2F22/param1/5
Will result in the output of 10
instead of the expected 10%2F22
.
Dying on $params shows 22/param1/5
confirming that the slash is being interpreted as a real one.