Bug #77285 [NEW]: Missing REQUEST_METHOD in INPUT_SERVER
| From: | m49434s at gmail dot com | Date: | Tue, 11 Dec 2018 22:44:19 +0000 |
| Subject: | Bug #77285 [NEW]: Missing REQUEST_METHOD in INPUT_SERVER | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-218401@lists.php.net to get a copy of this message | ||
From: m49434s at gmail dot com
Operating system: FreeBSD
PHP version: 7.3.0
Package: Filter related
Bug Type: Bug
Bug description:Missing REQUEST_METHOD in INPUT_SERVER
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 bug report at https://bugs.php.net/bug.php?id=77285&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77285&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77285&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77285&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77285&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77285&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77285&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77285&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77285&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77285&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77285&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77285&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77285&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77285&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77285&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77285&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77285&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77285&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77285&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77285&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77285&r=mysqlcfg