- πͺπΈSpain jaramoshu
In patch with code:
- $path = implode('/', $args); +$path = '/' . implode('/', $args);
It doesn't solve my problem. However, the following modification does:
if ((strpos($path, '/') !== 0) && (strpos($path, '#') !== 0) && (strpos($path, '?') !== 0)) { $url = $path; } else { $url = Url::fromUserInput($path, $options)->toString(); }
- First commit to issue fork.
- πΊπ¦Ukraine nnevill Lutsk
It's not the best patch in the world but it works.
But it's not applicable for 8.x-1.0-alpha6 so I've prepared patch for that specific version.
- First commit to issue fork.
- last update
7 months ago 28 pass - last update
7 months ago 28 pass - last update
7 months ago 28 pass - π¬π§United Kingdom scott_euser
Patch solves the issue correctly as it matches the conditions where an InvalidArgumentException would get thrown to prevent those conditions from being met and resulting in the fatal error. Ie, here is the excerpt from the ::fromUserInput() method
if (!str_starts_with($user_input, '/') && !str_starts_with($user_input, '#') && !str_starts_with($user_input, '?')) { throw new \InvalidArgumentException("The user-entered string '$user_input' must begin with a '/', '?', or '#'."); }
Thanks! Going to quickly convert it to a merge request, but since I'm not making any changes, just facilitating the maintainer's job, suggesting RTBC as status.