View Issue Details

IDProjectCategoryView StatusLast Update
0016408mantisbtcustomizationpublic2014-02-07 18:24
Reportervboctor Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.2.15 
Target Version1.2.16Fixed in Version1.2.16 
Summary0016408: config_eval() fails on configs that reference array values
Description

Add support for config substitution for non-string types like array(). For example, setting $g_handle_bug_threshold to an array causes failure due to the following substitution:

$g_update_bug_assign_threshold = '%handle_bug_threshold%';

The failure looks as follows:

SYSTEM NOTICE: 'Array to string conversion' in '/var/www/mantisbt/core/config_api.php' line 605

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master-1.2.x 1ac581e4

2013-09-25 15:56

vboctor


Details Diff
Fixes 0016408: config_eval() fails on configs that reference array values

The $g_update_bug_assign_threshold is set to '%handle_bug_threshold%'.
If the value of $g_handle_bug_threshold is set to an array instead of a string/int, a system notice is generated that array to string conversion is done in config_eval().

The fix is to detect the direct assignment case and not use a string replace,
but use normal assignment. This will make it work for complex types like
arrays.

We still don't support $g_x = '%y%_aaa' where $g_y is not a string or int,
but that shouldn't be an issue.
Affected Issues
0016408
mod - core/config_api.php Diff File

MantisBT: master 4bf99262

2013-09-25 15:56

vboctor

Committer: dregad


Details Diff
Fixes 0016408: config_eval() fails on configs that reference array values

The $g_update_bug_assign_threshold is set to '%handle_bug_threshold%'.
If the value of $g_handle_bug_threshold is set to an array instead of a string/int, a system notice is generated that array to string conversion is done in config_eval().

The fix is to detect the direct assignment case and not use a string replace,
but use normal assignment. This will make it work for complex types like
arrays.

We still don't support $g_x = '%y%_aaa' where $g_y is not a string or int,
but that shouldn't be an issue.

Signed-off-by: Damien Regad <dregad@mantisbt.org>

Cherry-pick of 1ac581e46e2970475fdbe6434a9ac18a252e9048; Victor's
original commit was amended to follow coding guidelines.
Affected Issues
0016408
mod - core/config_api.php Diff File