#2494 - config_editor rewrites zone mapping array variables incorrectly

This is a spacer post for a website comment topic. The content this topic relates to: #2494 - config_editor rewrites zone mapping array variables incorrectly
Nope, it transforms it to two lines, like...

$SITE_INFO['ZONE_MAPPING_zone'][] = '';
$SITE_INFO['ZONE_MAPPING_zone'][] = 'sub.domain.com';

Which is equivalent.

Maybe you accidentally removed the first line, or assumed it wouldn't work.

The config_editor strictly works on a line-by-line basis, it can't do structure.
It still caused an error via. users online details page. The stack trace pointed to that specific problem in the _config.php file.
It'd need to be something else I'm afraid.

(I got the lines the wrong way around in my last reply so I'll clarify in more detail)

I manually added to _config.php:
$SITE_INFO['ZONE_MAPPING_zone'] = array('sub.domain.com','');

I then saved using the config_editor.php script, which rewrote it to:
$SITE_INFO['ZONE_MAPPING_zone'][] = 'sub.domain.com';
$SITE_INFO['ZONE_MAPPING_zone'][] = '';

I then wrote a script to make sure I'm not wrong somehow...

$SITE_INFO=array();
$SITE_INFO['ZONE_MAPPING_zone'][] = 'sub.domain.com';
$SITE_INFO['ZONE_MAPPING_zone'][] = '';
var_dump($SITE_INFO);

$SITE_INFO=array();
$SITE_INFO['ZONE_MAPPING_zone'] = array('sub.domain.com','');
var_dump($SITE_INFO);

Which resulted in the expected output of the same thing twice...


array(1) {
["ZONE_MAPPING_zone"]=>
array(2) {
[0]=>
string(14) "sub.domain.com"
[1]=>
string(0) ""
}
}
array(1) {
["ZONE_MAPPING_zone"]=>
array(2) {
[0]=>
string(14) "sub.domain.com"
[1]=>
string(0) ""
}
}



I also tried saving the config a second time, just to make sure nothing is getting stripped - no problems.
0 guests and 0 members have recently viewed this.