View Issue Details

IDProjectCategoryView StatusLast Update
0024032mantisbtscriptingpublic2018-02-22 15:06
ReporterVLroyrenn Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version2.11.1 
Summary0024032: PHP Scripts called from the command line may unexpectedly and silently stop when calling certain functions
Description

When executing a PHP script hooking into the mantisbt API, any function call that end up calling auth_get_current_user_id (such as BugData::create()) causes the script to immediately stop in a non-catchable, unlogged and overall pretty hard to debug manner. This behavior can be corrected by setting $g_cache_current_user_id to a preset value if php is detected to run in CLI mode, but I have not seen this documented anywhere.

auth_get_current_user_id (or the correct underlying function) should probably check whether or not PHP is running in CLI mode, and throw an exception or quit with an error if $g_cache_current_user_id is not set instead of attempting to get the user id from non-existant session data.

TagsNo tags attached.

Activities

There are no notes attached to this issue.