View Issue Details

IDProjectCategoryView StatusLast Update
0023705mantisbtcode cleanuppublic2017-12-08 21:58
Reportervboctor Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionno change required 
Product Version2.9.0 
Summary0023705: trigger_error() should use E_USER_ERROR instead of E_ERROR
Description

Based on PHP documentation the trigger_error() calls should use E_USER_ERROR, E_USER_WARNING, E_USER_DEPRECATED, etc. We often use the error types that are reserved for the PHP runtime like E_ERROR, E_WARNING, E_DEPRECATED.

TagsNo tags attached.

Activities

dregad

dregad

2017-12-07 04:34

developer   ~0058335

Last edited: 2017-12-07 04:35

We often use the error types that are reserved for the PHP runtime like E_ERROR, E_WARNING, E_DEPRECATED.

I don't think we do... Where did you see that ?
Typically, trigger_error() is called with MantisBT-specific constant ERROR, which maps to E_USER_ERROR, not E_ERROR [1]

[1] https://github.com/mantisbt/mantisbt/blob/master/core/constant_inc.php#L50-L54

vboctor

vboctor

2017-12-08 21:58

manager   ~0058367

You are right. I got confused thinking that ERROR is E_ERROR.