]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Config/Cache/ConfigCache.php
Merge pull request #6678 from rabuzarus/20190217_-_fix_magicLinks_mentions
[friendica.git] / src / Core / Config / Cache / ConfigCache.php
index b1172c0c82639c8783ba9d260158dc6b96a92d91..54da327dba9e55b3d5c719a195d7a179ced2a4fe 100644 (file)
@@ -55,6 +55,8 @@ class ConfigCache implements IConfigCache, IPConfigCache
        {
                if (isset($this->config[$cat][$key])) {
                        return $this->config[$cat][$key];
+               } elseif ($key == null && isset($this->config[$cat])) {
+                       return $this->config[$cat];
                } else {
                        return '!<unset>!';
                }
@@ -65,8 +67,8 @@ class ConfigCache implements IConfigCache, IPConfigCache
         */
        public function has($cat, $key = null)
        {
-               return isset($this->config[$cat][$key])
-                       && $this->config[$cat][$key] !== '!<unset>!';
+               return (isset($this->config[$cat][$key]) && $this->config[$cat][$key] !== '!<unset>!') ||
+               ($key == null && isset($this->config[$cat]) && $this->config[$cat] !== '!<unset>!' && is_array($this->config[$cat]));
        }
 
        /**
@@ -105,8 +107,8 @@ class ConfigCache implements IConfigCache, IPConfigCache
         */
        public function hasP($uid, $cat, $key = null)
        {
-               return isset($this->config[$uid][$cat][$key])
-                       && $this->config[$uid][$cat][$key] !== '!<unset>!';
+               return (isset($this->config[$uid][$cat][$key]) && $this->config[$uid][$cat][$key] !== '!<unset>!') ||
+                       ($key == null && isset($this->config[$uid][$cat]) && $this->config[$uid][$cat] !== '!<unset>!' && is_array($this->config[$uid][$cat]));
        }
 
        /**
@@ -144,6 +146,8 @@ class ConfigCache implements IConfigCache, IPConfigCache
        {
                if (isset($this->config[$uid][$cat][$key])) {
                        return $this->config[$uid][$cat][$key];
+               } elseif ($key == null && isset($this->config[$uid][$cat])) {
+                       return $this->config[$uid][$cat];
                } else {
                        return '!<unset>!';
                }