View Issue Details

IDProjectCategoryView StatusLast Update
0033010mantisbtadministrationpublic2023-10-31 16:32
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.26.0Fixed in Version2.26.0 
Summary0033010: PHP errors triggered by Admin Checks cause silent failure
Description

If an Admin check throws an exception, it is caught by the default exception handler and MantisBT triggers an ERROR_PHP.

This in turn is caught by check_error_handler(), which just stores it in $g_error_raised but as code execution can't continue it is never reported back to the end-user.

This causes confusion and makes debugging / troubleshooting of the admin checks difficult.

TagsNo tags attached.

Relationships

related to 0032940 closeddregad Add admin check to detect users without e-mail address when allow_empty_email = OFF 

Activities

dregad

dregad

2023-10-08 10:20

developer   ~0068193

Fixed as part of PR https://github.com/mantisbt/mantisbt/pull/1919

Related Changesets

MantisBT: master ce841a23

2023-10-08 10:00

dregad


Details Diff
Fix Admin Checks silently failing after Exception

If an Admin check throws an exception, it is caught by the default
exception handler and MantisBT triggers an ERROR_PHP.

This in turn is caught by check_error_handler(), which just stores it in
$g_error_raised, but since code execution can't continue it is never
reported to the end-user, which causes confusion and makes debugging
of the admin checks difficult.

To avoid this, check_error_handler() now detects if it's processing an
E_USER_ERROR of type ERROR_PHP and lets PHP handle it.

Fixes 0033010
Affected Issues
0033010
mod - admin/check/check_api.php Diff File