Skip to content

Commit 0904dd3

Browse files
committed
Remove INPUT_SESSION and INPUT_REQUEST
These were never supported and always generated a warning. Remove them entirely for PHP 8.
1 parent 8aa6d5a commit 0904dd3

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ PHP 8.0 UPGRADE NOTES
9191
. The FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED flags for the
9292
FILTER_VALIDATE_URL filter have been removed. The scheme and host are (and
9393
have been) always required.
94+
. The INPUT_REQUEST and INPUT_SESSION source for filter_input() etc have been
95+
removed. These were never implemented and their use always generated a
96+
warning.
9497

9598
- GD:
9699
. The deprecated function image2wbmp() has been removed.

ext/filter/filter.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ PHP_MINIT_FUNCTION(filter)
222222
REGISTER_LONG_CONSTANT("INPUT_COOKIE", PARSE_COOKIE, CONST_CS | CONST_PERSISTENT);
223223
REGISTER_LONG_CONSTANT("INPUT_ENV", PARSE_ENV, CONST_CS | CONST_PERSISTENT);
224224
REGISTER_LONG_CONSTANT("INPUT_SERVER", PARSE_SERVER, CONST_CS | CONST_PERSISTENT);
225-
REGISTER_LONG_CONSTANT("INPUT_SESSION", PARSE_SESSION, CONST_CS | CONST_PERSISTENT);
226-
REGISTER_LONG_CONSTANT("INPUT_REQUEST", PARSE_REQUEST, CONST_CS | CONST_PERSISTENT);
227225

228226
REGISTER_LONG_CONSTANT("FILTER_FLAG_NONE", FILTER_FLAG_NONE, CONST_CS | CONST_PERSISTENT);
229227

@@ -549,13 +547,8 @@ static zval *php_filter_get_storage(zend_long arg)/* {{{ */
549547
}
550548
array_ptr = !Z_ISUNDEF(IF_G(env_array)) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
551549
break;
552-
case PARSE_SESSION:
553-
/* FIXME: Implement session source */
554-
php_error_docref(NULL, E_WARNING, "INPUT_SESSION is not yet implemented");
555-
break;
556-
case PARSE_REQUEST:
557-
/* FIXME: Implement request source */
558-
php_error_docref(NULL, E_WARNING, "INPUT_REQUEST is not yet implemented");
550+
default:
551+
php_error_docref(NULL, E_WARNING, "Unknown source");
559552
break;
560553
}
561554

ext/filter/tests/040.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ var_dump(filter_has_var(0, "cc"));
2121

2222
echo "Done\n";
2323
?>
24-
--EXPECT--
24+
--EXPECTF--
2525
bool(false)
2626
bool(true)
2727
bool(true)
2828
bool(true)
2929
bool(true)
3030
bool(false)
3131
bool(false)
32+
33+
Warning: filter_has_var(): Unknown source in %s on line %d
3234
bool(false)
3335
bool(false)
3436
Done

0 commit comments

Comments
 (0)