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

[RFC] Deprecate explicit use of FILTER_FLAG_SCHEME|HOST_REQUIRED #3322

Closed
wants to merge 2 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jun 24, 2018

As of PHP 5.2.1 FILTER_VALIDATE_URL implies FILTER_FLAG_SCHEME_REQUIRED
| FILTER_FLAG_HOST_REQUIRED, which makes these constants useless at
best, if not even misleading. Therefore we deprecate the explicit use
of these constants for FILTER_VALIDATE_URL, to pave the way for their
eventual removal.

See also https://bugs.php.net/75442 and
https://externals.io/message/100981.

As of PHP 5.2.1 FILTER_VALIDATE_URL implies FILTER_FLAG_SCHEME_REQUIRED
| FILTER_FLAG_HOST_REQUIRED, which makes these constants useless at
best, if not even misleading.  Therefore we deprecate the explicit use
of these constants for FILTER_VALIDATE_URL, to pave the way for their
eventual removal.

See also <https://bugs.php.net/75442> and
<https://externals.io/message/100981>.
@cmb69 cmb69 changed the title Deprecate explicit use of FILTER_FLAG_SCHEME|HOST_REQUIRED [RFC] Deprecate explicit use of FILTER_FLAG_SCHEME|HOST_REQUIRED Jun 26, 2018
@cmb69
Copy link
Member Author

cmb69 commented Jun 26, 2018

This has been added to the “Deprecations for PHP 7.3” RFC, so don't merge until accepted.

@nikic
Copy link
Member

nikic commented Jul 16, 2018

Would you like to add a test for this deprecation?

@cmb69
Copy link
Member Author

cmb69 commented Jul 16, 2018

Would you like to add a test for this deprecation?

Sure. I'll catch up on this ASAP.

We settle for testing filter_var() only instead of all relevant filter
functions, and make sure that we do not only test the actual
deprecation message, but also that FILTER_FLAG_SCHEME_REQUIRED and
FILTER_FLAG_HOST_REQUIRED are implicitly used.
@php-pulls
Copy link

Comment on behalf of cmb at php.net:

Applied via c0407d9.
Note to UPGRADING added via 79a27cc.

@php-pulls php-pulls closed this Jul 17, 2018
@cmb69 cmb69 deleted the deprecate-scheme-host-flags branch July 17, 2018 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants