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
base: master
from

Conversation

4 participants
@cmb69
Copy link
Contributor

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.

Deprecate explicit use of FILTER_FLAG_SCHEME|HOST_REQUIRED
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

This comment has been minimized.

Copy link
Contributor

cmb69 commented Jun 26, 2018

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

@krakjoe krakjoe added the RFC label Jul 2, 2018

@nikic

This comment has been minimized.

Copy link
Member

nikic commented Jul 16, 2018

Would you like to add a test for this deprecation?

@cmb69

This comment has been minimized.

Copy link
Contributor

cmb69 commented Jul 16, 2018

Would you like to add a test for this deprecation?

Sure. I'll catch up on this ASAP.

Add a test for the deprecations
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

This comment has been minimized.

Copy link

php-pulls commented Jul 17, 2018

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 cmb69:deprecate-scheme-host-flags branch Jul 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment