[RFC] Deprecate explicit use of FILTER_FLAG_SCHEME|HOST_REQUIRED#3322
Closed
cmb69 wants to merge 2 commits intophp:masterfrom
Closed
[RFC] Deprecate explicit use of FILTER_FLAG_SCHEME|HOST_REQUIRED#3322cmb69 wants to merge 2 commits intophp:masterfrom
cmb69 wants to merge 2 commits intophp:masterfrom
Conversation
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>.
Member
Author
|
This has been added to the “Deprecations for PHP 7.3” RFC, so don't merge until accepted. |
Member
|
Would you like to add a test for this deprecation? |
Member
Author
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.