spatie/url

Spatie menu fails of Url::fromString method fails

dmitryuk opened this issue · 1 comments

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:

  1. parse_url('///remote/fgt_lang?lang=/../../../..//////////dev/') will return false
  2. 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?

Thanks!