From 6e28cdf2eea5133425066fdbc7a9dd81e73c3f20 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Mon, 13 Jun 2016 10:28:40 +0200 Subject: [PATCH] Fix Config and PConfig ::get() on new keys --- include/Core/Config.php | 2 +- include/Core/PConfig.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Core/Config.php b/include/Core/Config.php index ff35418849..8e387ca6f0 100644 --- a/include/Core/Config.php +++ b/include/Core/Config.php @@ -172,7 +172,7 @@ class Config { // manage array value $dbvalue = (is_array($value)?serialize($value):$value); $dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue); - if(self::get($family,$key,null,true) === false) { + if(is_null(self::get($family,$key,null,true))) { $a->config[$family][$key] = $value; $ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ", dbesc($family), diff --git a/include/Core/PConfig.php b/include/Core/PConfig.php index c47559d0eb..ab351ef2c2 100644 --- a/include/Core/PConfig.php +++ b/include/Core/PConfig.php @@ -161,7 +161,7 @@ class PConfig { // manage array value $dbvalue = (is_array($value)?serialize($value):$value); - if(self::get($uid,$family,$key,null, true) === false) { + if(is_null(self::get($uid,$family,$key,null, true))) { $a->config[$uid][$family][$key] = $value; $ret = q("INSERT INTO `pconfig` ( `uid`, `cat`, `k`, `v` ) VALUES ( %d, '%s', '%s', '%s' ) ", intval($uid),