View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032840 | mantisbt | bugtracker | public | 2023-08-21 18:43 | 2023-09-03 06:08 |
Reporter | TomekAP | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | duplicate | ||
Summary | 0032840: wrong error handling with PHP >= 8.0 | ||||
Description | in error_api.php:
but PHP states (https://www.php.net/manual/en/language.operators.errorcontrol.php): Prior to PHP 8.0.0, the error_reporting() called inside the custom error handler always returned 0 if the error was suppressed by the @ operator. As of PHP 8.0.0, it returns the value E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE. so the code from PHP >= 8.0 will not return immediatelly anymore. | ||||
Tags | No tags attached. | ||||
Thanks for the report. Did you actually face a situation where this caused a problem ? If so it would be good to have some details about your use case. |
|
|
|
This is not clear, what do you mean ? |
|
class ....Filter extends MantisFilter { class ....Plugin extends MantisPlugin {
Now is clearer? |
|
Yes thank you. Does your plugin make use of the A stack trace would help, or even better a reproducible test case so I can get a good understanding of the problem. |
|
but @ has nothing here to do.
in filter_form_api there is a function filter_form_get_input:
In my case the function $t_function_name doesn`t exist, so the error is thrown - trigger_error( ERROR_FILTER_NOT_FOUND, ERROR );.
Before PHP 8.0 it worked, becasue error_reporting() was 0 in case of @, but since PHP 8.0, error_reporting is: E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE so the condition in if is not fullfulled and we don`t immediately exit a function, but the error is being handled furthermore. |
|
Sorry but I'm still not seeing the whole picture...
But it does... Notice the Anyway more importantly, which release of MantisBT are you using ? I would guess it's an older, unsupported version because this code was removed in June 2021 (replaced by a try/catch block) and released in 2.25.2, see 0028803. So your problem appears to be a duplicate of that. |
|
then sorry for bothering. We were using 2.25.0, after upgrade the error disappeared. I thought PHP 8.0 is fully tested with 2.25.0 |
|
Thanks for the feedback. You should always upgrade to the latest hotfix for a given release, to benefit from bug and security fixes. Anyway, good to hear that your problem is solved. |
|