Bug #77285 [Com]: Missing REQUEST_METHOD in INPUT_SERVER
Edit report at https://bugs.php.net/bug.php?id=77285&edit=1
ID: 77285
Comment by: ma dot zoon at quicknet dot nl
Reported by: m49434s at gmail dot com
Summary: Missing REQUEST_METHOD in INPUT_SERVER
Status: Open
Type: Bug
Package: Filter related
Operating System: FreeBSD
PHP Version: 7.3.0
Block user comment: N
Private report: N
New Comment:
i can confirm proper working on php 7.2.13 and broken on php 7.3.0.
Previous Comments:
------------------------------------------------------------------------
[2018-12-11 22:44:19] m49434s at gmail dot com
Description:
------------
With PHP 7.3.0 input validation using filter_input(INPUT_SERVER,'REQUEST_METHOD',...) is
broken because the field 'REQUEST_METHOD' is not mapped. The code is working as expected
in 7.2.x and previous releases.
Test script:
---------------
<?php
if(filter_has_var(INPUT_SERVER,'REQUEST_METHOD')):
echo 'filter_has_var: INPUT_SERVER field REQUEST_METHOD exists',PHP_EOL,PHP_EOL;
else:
echo 'filter_has_var: INPUT_SERVER field REQUEST_METHOD does not exist',PHP_EOL,PHP_EOL;
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
endif;
?>
<form action="test.php" method="post" id="iform"
name="iform">
<input type="text" id="username" name="username"
placeholder="Username" autofocus="autofocus">
<input type="password" id="password" name="password"
placeholder="Password">
<input type="submit" value="Login">
</form>
Expected result:
----------------
The script should display 'filter_has_var: INPUT_SERVER field REQUEST_METHOD exists' after
pressing the login button.
Actual result:
--------------
Script displays 'filter_has_var: INPUT_SERVER field REQUEST_METHOD does not exist'
followed by the content of $_SERVER after pressing the login button.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77285&edit=1
Thread (8 messages)