Spatie menu fails of Url::fromString method fails
dmitryuk opened this issue · 1 comments
dmitryuk commented
Spatie menu has a method ActiveUrlChecker::check
(https://github.com/spatie/menu/blob/master/src/ActiveUrlChecker.php#L10) that calls Url::fromString
.
Because url path can be invalid (our case ///remote/fgt_lang?lang=/../../../..//////////dev/
) it will throw an exception:
parse_url('///remote/fgt_lang?lang=/../../../..//////////dev/')
will returnfalse
array_merge(false)
finally throw an exception https://github.com/spatie/url/blob/master/src/Url.php#L43
Why it needed to do array_merge
with only 1 argument?
What to do if parse_url
failed?
dmitryuk commented
Thanks!