View Issue Details

IDProjectCategoryView StatusLast Update
0033588mantisbtadministrationpublic2024-02-20 16:58
Reportergrubernd Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.26.0 
Target Version2.26.1Fixed in Version2.26.1 
Summary0033588: Creating an Configuration Option with complex array fails when number is negative
Description

as per summary and steps to reproduce

Steps To Reproduce

Create Configuration Option:
Configuration Option: due_date_warning_levels
Type: complex
Value: array(-432000,0,604800)

==> will fail with:
APPLICATION ERROR #103
Cannot set configuration option "due_date_warning_levels": Invalid token '-'

Additional Information
  • The error message seems to be coming from process_array() in the ConfigParser.class.php since that is the only function where the exception thrown matches the error message
  • It does not matter which of the numbers is negative
  • Using the multiline format of already created configurations works
  • Editing an exisiting configuration works
TagsNo tags attached.

Activities

dregad

dregad

2024-01-31 06:02

developer   ~0068492

Bug is confirmed.

As a workaround, create the config by defining the array index for the negative value, e.g.

array(0=>-432000,0,604800)

Related Changesets

MantisBT: master-2.26 0de6dd21

2024-01-31 06:19

dregad


Details Diff
Allow negative number when editing array config

Previously, attempting to set the option's value to `array( -1, 0 )`
would trigger APPLICATION ERROR 103: Cannot set configuration option
"due_date_warning_levels": Invalid token '-'.

Updating ConfigParser::process_array() to properly handle signed integer
values

Fixes 0033588
Affected Issues
0033588
mod - core/classes/ConfigParser.class.php Diff File