View Issue Details

IDProjectCategoryView StatusLast Update
0037368mantisbtadministrationpublic2026-09-06 06:40
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037368: Calling access_denied() function from CLI triggers PHP warning
Description

When running from CLI, PHP throws
SYSTEM WARNING: http_response_code(): Cannot set response code - headers already sent.

It makes no sense to output HTML, send a response code and redirect in a CLI context, this code should not be executed.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master b92b04d7

2026-09-05 09:42

dregad


Details Diff
Fix PHP warning in access_denied() from CLI

When running from CLI, PHP throws SYSTEM WARNING: http_response_code():
Cannot set response code - headers already sent.

It makes no sense to output HTML, send a response code and redirect in
a CLI context anyway, so this commit adds a bypass that just aborts the
script with exit code 1.

Fixes 0037368
Affected Issues
0037368
mod - core/access_api.php Diff File