Bug #77285 [Opn->Fbk]: Missing REQUEST_METHOD in INPUT_SERVER
Edit report at https://bugs.php.net/bug.php?id=77285&edit=1
ID: 77285
Updated by: cmb@php.net
Reported by: m49434s at gmail dot com
Summary: Missing REQUEST_METHOD in INPUT_SERVER
-Status: Open
+Status: Feedback
Type: Bug
Package: Filter related
Operating System: FreeBSD
PHP Version: 7.3.0
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I cannot reproduce this with PHP-7.4 and the CGI SAPI. Can
anybody else still reproduce this with any of the actively
supported PHP versions[1]?
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2018-12-12 13:55:09] ma dot zoon at quicknet dot nl
i can confirm proper working on php 7.2.13 and broken on php 7.3.0.
------------------------------------------------------------------------
[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)