Skip to content
New issue

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

Phalcon\Validation\Validator\Url improvement #13548

Closed
scrnjakovic opened this issue Oct 22, 2018 · 1 comment
Closed

Phalcon\Validation\Validator\Url improvement #13548

scrnjakovic opened this issue Oct 22, 2018 · 1 comment
Labels
enhancement Enhancement to the framework
Milestone

Comments

@scrnjakovic
Copy link
Contributor

I think this validator should accept flags.

Flag Used with Description
FILTER_FLAG_SCHEME_REQUIRED FILTER_VALIDATE_URL Requires the URL to contain a scheme part. deprecated
FILTER_FLAG_HOST_REQUIRED FILTER_VALIDATE_URL Requires the URL to contain a host part. deprecated
FILTER_FLAG_PATH_REQUIRED FILTER_VALIDATE_URL Requires the URL to contain a path part.
FILTER_FLAG_QUERY_REQUIRED FILTER_VALIDATE_URL Requires the URL to contain a query string.
$url->addValidator(
    new Url(
        [
            'flags' => [
                'FILTER_FLAG_PATH_REQUIRED'
        ]
    )
);

Actually given that those two flags had no effect since 5.x.x maybe we should consider custom URL validator because filter_var sucks. We need more control, like whether or not to consider protocol for an example. Or simply ditch Url altogether and use Regex...

@Jurigag Jurigag added the enhancement Enhancement to the framework label Oct 25, 2018
@Jurigag Jurigag added this to the 4.0.0 milestone Oct 25, 2018
@Jurigag Jurigag self-assigned this Oct 25, 2018
@niden niden mentioned this issue May 10, 2019
4 tasks
niden added a commit that referenced this issue May 14, 2019
niden added a commit that referenced this issue May 14, 2019
niden added a commit that referenced this issue May 14, 2019
niden added a commit that referenced this issue May 14, 2019
niden added a commit that referenced this issue May 14, 2019
@niden
Copy link
Member

niden commented May 14, 2019

Resolved in #14057

@niden niden closed this as completed May 14, 2019
@niden niden added the 4.0 label Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to the framework
Projects
None yet
Development

No branches or pull requests

3 participants