summaryrefslogtreecommitdiff
path: root/ext/filter/logical_filters.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-07-16 22:53:24 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2018-07-17 10:45:46 +0200
commitc0407d95f7bd9027d087cf8cc0f5a109b22430eb (patch)
treece7fa3739ec8d3dc4caf2efdbbb176d5d9c9c649 /ext/filter/logical_filters.c
parentffa41787d58580abc41849bdeb5fd19f4e69e4f3 (diff)
downloadphp-git-c0407d95f7bd9027d087cf8cc0f5a109b22430eb.tar.gz
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 <https://wiki.php.net/rfc/deprecations_php_7_3#filter_flag_scheme_required_and_filter_flag_host_required>.
Diffstat (limited to 'ext/filter/logical_filters.c')
-rw-r--r--ext/filter/logical_filters.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 0fe324268d..525cd0d097 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -539,6 +539,11 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
php_url *url;
size_t old_len = Z_STRLEN_P(value);
+ if (flags & (FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)) {
+ php_error_docref(NULL, E_DEPRECATED,
+ "explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated");
+ }
+
php_filter_url(value, flags, option_array, charset);
if (Z_TYPE_P(value) != IS_STRING || old_len != Z_STRLEN_P(value)) {