View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0028803 | mantisbt | custom fields | public | 2021-06-15 03:21 | 2022-10-13 04:33 |
Reporter | fxm | Assigned To | dregad | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 2.25.2 | Fixed in Version | 2.25.2 | ||
Summary | 0028803: PHP 8: "Bad Request" error on custom field filters | ||||
Description | Since update from PHP 7 to PHP 8, a "bad request" message is displayed in filter for custom fields. | ||||
Additional Information | PHP 8 is mandatory due to security issues in PHP 7. | ||||
Tags | PHP 8 | ||||
Attached Files | |||||
I would expect that PHP 7.3 and 7.4 do still get security fixes. |
|
Hi @atrol After discussion with my security officer, I downgrade PHP version from 8.0.4 to 7.4.20 and issue is solved. It can be set in a lower priority. |
|
Always the same issue with security guys... ;-)
What about
@atrol as you have confirmed the issue, I assume you were able to replicate it (I didn't try myself), can you provide steps to reproduce ? Or or @fxm details information about your Environment and Test case custom fields definition. |
|
IIRC I found the same issue some weeks ago using PHP 8.0.3 on a Windows XAMPP environment. |
|
OK I can reproduce it. So the AJAX fails in return_dynamic_filters.php at line 91:
filter_form_get_input() call fails (i.e. function throws ERROR_FILTER_NOT_FOUND error, but due to change in @ operator behavior in which no longer silences fatal errors on PHP 8 [1], the error is not caught as it was on earlier versions. |
|
MantisBT: master-2.25 c56be779 2021-06-15 15:21 Details Diff |
filter_form_get_input() now throws StateException Previously the function called trigger_error() and returned false to handle usage of @ operator by caller. This no longer works on PHP 8, so we now throw an exception instead. Issue 0028803 |
Affected Issues 0028803 |
|
mod - core/filter_form_api.php | Diff File | ||
MantisBT: master-2.25 8bece942 2021-06-15 15:27 Details Diff |
Remove usage of @ operator Replace with try/catch block. Fixes 0028803 |
Affected Issues 0028803 |
|
mod - return_dynamic_filters.php | Diff File |