aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-01-03 23:53:37 -0800
committerFriendika <info@friendika.com>2011-01-03 23:53:37 -0800
commitdbab3100de5f6e8f0a617c5cfdc3926df47f9351 (patch)
tree21de390162fd70519f02c41467c062fc3ef8ecfa
parent20cc007655337e7a34784799a2fea924c06a82ce (diff)
downloadvolse-hubzilla-dbab3100de5f6e8f0a617c5cfdc3926df47f9351.tar.gz
volse-hubzilla-dbab3100de5f6e8f0a617c5cfdc3926df47f9351.tar.bz2
volse-hubzilla-dbab3100de5f6e8f0a617c5cfdc3926df47f9351.zip
set_config anomaly
-rw-r--r--boot.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index cbbe55edc..600ce2cc0 100644
--- a/boot.php
+++ b/boot.php
@@ -1096,7 +1096,6 @@ if(! function_exists('set_config')) {
function set_config($family,$key,$value) {
global $a;
- $a->config[$family][$key] = $value;
if(get_config($family,$key,true) === false) {
$ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ",
@@ -1113,6 +1112,9 @@ function set_config($family,$key,$value) {
dbesc($family),
dbesc($key)
);
+
+ $a->config[$family][$key] = $value;
+
if($ret)
return $value;
return $ret;
@@ -1149,11 +1151,13 @@ function get_pconfig($uid,$family, $key, $instore = false) {
return $a->config[$uid][$family][$key];
}
}
+
$ret = q("SELECT `v` FROM `pconfig` WHERE `uid` = %d AND `cat` = '%s' AND `k` = '%s' LIMIT 1",
intval($uid),
dbesc($family),
dbesc($key)
);
+
if(count($ret)) {
$a->config[$uid][$family][$key] = $ret[0]['v'];
return $ret[0]['v'];
@@ -1186,7 +1190,6 @@ if(! function_exists('set_pconfig')) {
function set_pconfig($uid,$family,$key,$value) {
global $a;
- $a->config[$uid][$family][$key] = $value;
if(get_pconfig($uid,$family,$key,true) === false) {
$ret = q("INSERT INTO `pconfig` ( `uid`, `cat`, `k`, `v` ) VALUES ( %d, '%s', '%s', '%s' ) ",
@@ -1206,6 +1209,8 @@ function set_pconfig($uid,$family,$key,$value) {
dbesc($key)
);
+ $a->config[$uid][$family][$key] = $value;
+
if($ret)
return $value;
return $ret;