Closed jobara closed 5 months ago
We're using Laravel's active_url validation rule. It will pass the inputted URL through PHP's parse_url function, with the component set to PHP_URL_HOST. (See: https://github.com/laravel/framework/blob/fc7b8f6984c58265d1fe111dafa124f9620db767/src/Illuminate/Validation/Concerns/ValidatesAttributes.php#L125 ). However, as noted in the php docs, if the scheme is omitted the url is returned as the 'path' value. The result is that the host is empty and active_url is getting a null value returned from parse_url and as such, fails validation.
The simple solution would be to require the scheme be provided.
Prerequisites
Describe the bug
When creating the public page for an organization you can enter in the org's website link. The description says "Website links must be in the format “https://example.com”, or “example.com”. " However, entering
example.com
throws the error "The Website link is not a valid URL.". Adding the scheme (e.g. https://) before will resolve the error.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Either the URL without the scheme should be accepted, or the instructions updated to not mention this as an acceptable format.
Screenshots