View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016408 | mantisbt | customization | public | 2013-09-25 19:54 | 2014-02-07 18:24 |
Reporter | vboctor | Assigned To | vboctor | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.15 | ||||
Target Version | 1.2.16 | Fixed in Version | 1.2.16 | ||
Summary | 0016408: 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 | ||||
Tags | No tags attached. | ||||
MantisBT: master-1.2.x 1ac581e4 2013-09-25 15:56 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 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 |