We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firstly, take a look at this line of code on UrlValidator class:
UrlValidator
protected function validate(string $value) : void { $parts = parse_url($value); if ($parts === false) { $this->addFailureMessage('validator.url.invalid'); } if (! isset($parts['scheme'])) { $this->addFailureMessage('validator.url.invalid'); } if (! isset($parts['host'])) { $this->addFailureMessage('validator.url.invalid'); } }
How about using the filter_var function to validate url?
filter_var
I think it can be quicker than using the parse_url function.
parse_url
$result = filter_var($value, FILTER_VALIDATE_URL); if ($result === false) { $this->addFailureMessage('validator.url.invalid'); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Firstly, take a look at this line of code on
UrlValidator
class:How about using the
filter_var
function to validate url?I think it can be quicker than using the
parse_url
function.The text was updated successfully, but these errors were encountered: