friendica/friendica — pull request #588 by fermionic (2013-01-19 06:45:25+00:00)
Title: insidious set_config bug

This should fix the "update database on a fresh install" bug. Essentially, if $a->config[$family] has been previously set to `!!`, then $a->config[$family][$key] will evaluate to $a->config[$family][0]. Then when you try to set $a->config[$family][$key] = $value, it will be equivalent to $a->config[$family][0] = $value[0]. So let's unset the family before assigning a value to a family's key.

Test case:
```php
$a = array('system' => '!!');
echo $a['system'] . "\n";
$a['system']['url'] = 'http://www.stupid.com';
echo $a['system']['url'] . "\n";

echo $a['system']['build'] . "\n";
echo $a['system'] . "\n";

unset($a['system']);

$a['system']['url'] = 'http://www.stupid.com';
echo $a['system']['url'] . "\n";
```

Output:
```
!!
h
h
h!
http://www.stupid.com
```