mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
insidious set_config bug
This commit is contained in:
parent
83448507b8
commit
bf26af5ac6
4 changed files with 26 additions and 9 deletions
|
@ -85,6 +85,15 @@ function get_config($family, $key, $instore = false) {
|
|||
if(! function_exists('set_config')) {
|
||||
function set_config($family,$key,$value) {
|
||||
global $a;
|
||||
|
||||
// If $a->config[$family] has been previously set to '!<unset>!', then
|
||||
// $a->config[$family][$key] will evaluate to $a->config[$family][0], and
|
||||
// $a->config[$family][$key] = $value will be equivalent to
|
||||
// $a->config[$family][0] = $value[0] (this causes infuriating bugs),
|
||||
// so unset the family before assigning a value to a family's key
|
||||
if($a->config[$family] === '!<unset>!')
|
||||
unset($a->config[$family]);
|
||||
|
||||
// manage array value
|
||||
$dbvalue = (is_array($value)?serialize($value):$value);
|
||||
$dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue);
|
||||
|
|
|
@ -19,7 +19,7 @@ function dbupdate_run(&$argv, &$argc) {
|
|||
load_config('config');
|
||||
load_config('system');
|
||||
|
||||
check_config($a);
|
||||
update_db($a);
|
||||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue