View Issue Details

IDProjectCategoryView StatusLast Update
0020850mantisbtadministrationpublic2016-06-12 00:42
ReportercproensaAssigned Todregad 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0-rc.1 
Target Version1.3.0-rc.2Fixed in Version1.3.0-rc.2 
Summary0020850: Configuration page parsing complex trims quotes incorrectly
Description

When parsing a complex value like

array ( 0 => '""a"' )

The result is:

array ( 0 => 'a' )

However, it should be:

array ( 0 => '""a"' )

The parser is trimming all quotes at start and end positions, regardless of lexical significance.

TagsNo tags attached.

Relationships

child of 0020787 closeddregad Setting of arrays (complex type) in Configuration Page doesn't work 

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master 8107ea50

2016-04-22 07:04:58

dregad

Details Diff
Parse complex configs using PHP tokenizer

Implements 2 classes to parse 'complex' config options in admin
Configuration Report page using PHP tokenizer instead of relying on
regular expressions.

- Tokenizer calls token_get_all() to build a list of tokens from the
given code
- Parser uses a Tokenizer object to convert the code (string) to an
actual PHP array variable

TODO: Move classes to an API and write automated tests

Fixes 0020787, 0020812, 0020813, 0020850, 0020851
mod - adm_config_set.php Diff File
mod - core/constant_inc.php Diff File
mod - lang/strings_english.txt Diff File

MantisBT: master 3ed60df1

2016-04-30 07:53:25

dregad

Details Diff
Parse complex configs using PHP tokenizer

Implements 2 classes to parse 'complex' config options in admin
Configuration Report page using PHP tokenizer instead of relying on
regular expressions.

- Tokenizer calls token_get_all() to build a list of tokens from the
given code
- Parser uses a Tokenizer object to convert the code (string) to an
actual PHP array variable

Includes PHPUnit test cases for the new parser code.

Fixes 0020787, 0020812, 0020813, 0020850, 0020851, 0016931, 0016932
PR https://github.com/mantisbt/mantisbt/pull/761
mod - adm_config_set.php Diff File
add - core/classes/ConfigParser.class.php Diff File
add - core/classes/Tokenizer.class.php Diff File
mod - core/constant_inc.php Diff File
mod - lang/strings_english.txt Diff File
mod - tests/Mantis/AllTests.php Diff File
add - tests/Mantis/ConfigParserTest.php Diff File

Issue History

Date Modified Username Field Change
2016-04-21 15:19 cproensa New Issue
2016-04-21 15:21 cproensa Relationship added related to 0020787
2016-04-21 19:30 cproensa Assigned To => cproensa
2016-04-21 19:30 cproensa Status new => assigned
2016-04-22 11:21 dregad Relationship replaced child of 0020787
2016-04-22 11:22 dregad Target Version => 1.3.0-rc.2
2016-04-22 11:23 dregad Category customization => administration
2016-04-22 13:41 cproensa Summary Configuration page parsing comples trims quotes incorrectly => Configuration page parsing complex trims quotes incorrectly
2016-04-24 05:42 cproensa Assigned To cproensa => dregad
2016-04-30 08:39 dregad Changeset attached => MantisBT master 3ed60df1
2016-04-30 08:42 dregad Status assigned => resolved
2016-04-30 08:42 dregad Fixed in Version => 1.3.0-rc.2
2016-04-30 08:42 dregad Resolution open => fixed
2016-04-30 09:01 dregad Changeset attached => MantisBT master 8107ea50
2016-06-12 00:42 vboctor Status resolved => closed