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

Comments

Projects
3 participants
@scrnjakovic
Copy link
Contributor

commented Oct 22, 2018

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 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 added this to In progress in 4.0 Release Nov 28, 2018

@niden niden moved this from In progress to To do in 4.0 Release Nov 28, 2018

@niden niden moved this from To do to In progress in 4.0 Release May 10, 2019

@niden niden referenced this issue May 10, 2019

Merged

T13548 validator url #14057

4 of 4 tasks complete

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

This comment has been minimized.

Copy link
Member

commented May 14, 2019

Resolved in #14057

@niden niden closed this May 14, 2019

4.0 Release automation moved this from In progress to Done 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
You can’t perform that action at this time.