REQUEST_TIME/REQUEST_TIME_FLOAT missing in INPUT_SERVER
未關閉
還沒有人認領這個 Issue。
Bug
Extension: filter
- 主要語言
- C
- 星號
- 40.4k
- 分支
- 8.1k
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 96
描述
Description
The following code:
<?php
if ( php_sapi_name() === 'cli' ) {
echo "filter_input does not work in PHP CLI";
exit;
}
var_dump( filter_input( INPUT_SERVER, 'REQUEST_TIME_FLOAT' ) );
var_dump( $_SERVER['REQUEST_TIME_FLOAT'] );
var_dump( filter_input( INPUT_SERVER, 'REQUEST_TIME' ) );
var_dump( $_SERVER['REQUEST_TIME'] );
Resulted in this output:
NULL
float(1737560728.0001)
NULL
int(1737560728)
But I expected this output instead:
float(1737560728.0001)
float(1737560728.0001)
int(1737560728)
int(1737560728)
These are the only 2 documented in https://www.php.net/manual/en/reserved.variables.server.php with that behavior? Is this a bug?
I only encountered this behavior with other (non-documented) variables HOME and USER
PHP Version
PHP 8.4
Operating System
No response
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 issue 中的 PHP reproducer 開始,將 filter_input(INPUT_SERVER, ...) 與 REQUEST_TIME_FLOAT 和 REQUEST_TIME 對應的 $_SERVER 值進行比較。追蹤 filter_input 的 INPUT_SERVER 進入點及其對這些變數的處理;當兩個呼叫都回傳預期輸出中顯示的文件值時,該 issue 即完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- php
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 42/100