MantisBT: master-2.26 6cb11276

Author Committer Branch Timestamp Parent
dregad dregad master-2.26 2024-09-16 13:45 master-2.26 16efe782
Affected Issues  0034634: Non-existing issue number does not throw a 404 in the UI
Changeset

Return HTTP response code when error occurs

Until now, our error handler displayed an error page, but actually
returned HTTP status code 200 (success), which was causing problems in
certain usage scenarios.

The REST and SOAP APIs do define a mapping from Mantis error to the
corresponding HTTP response code ApiObjectFactory::faultFromException().

This moves the mapping logic to a new Error API function
error_map_mantis_error_to_http_code(), and the error handler calls
http_response_code() with its return value so a proper HTTP status code
is returned to the user agent.

faultFromException() method was modified to use the new API function to
avoid code duplication.

Fixes 0034634

mod - api/soap/mc_api.php Diff File
mod - core/error_api.php Diff File