]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Config/Adapter/JITPConfigAdapter.php
Merge branch 'master' into develop
[friendica.git] / src / Core / Config / Adapter / JITPConfigAdapter.php
index 5c1627eba009175ca17821c8050200cdf9d30201..a0c6a9547fdc46bf83b512853f7824e3a71d0a1e 100644 (file)
@@ -88,9 +88,8 @@ class JITPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfigAdap
                // We store our setting values in a string variable.
                // So we have to do the conversion here so that the compare below works.
                // The exception are array values.
-               $dbvalue = (!is_array($value) ? (string)$value : $value);
-
-               $stored = $this->get($uid, $cat, $key, false);
+               $compare_value = (!is_array($value) ? (string)$value : $value);
+               $stored_value = $this->get($uid, $cat, $key, false);
 
                if (!isset($this->in_db[$uid])) {
                        $this->in_db[$uid] = [];
@@ -102,12 +101,12 @@ class JITPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfigAdap
                        $this->in_db[$uid][$cat][$key] = false;
                }
 
-               if (($stored === $dbvalue) && $this->in_db[$uid][$cat][$key]) {
+               if (isset($stored_value) && ($stored_value === $compare_value) && $this->in_db[$uid][$cat][$key]) {
                        return true;
                }
 
                // manage array value
-               $dbvalue = (is_array($value) ? serialize($value) : $dbvalue);
+               $dbvalue = (is_array($value) ? serialize($value) : $value);
 
                $result = DBA::update('pconfig', ['v' => $dbvalue], ['uid' => $uid, 'cat' => $cat, 'k' => $key], true);