]> git.mxchange.org Git - friendica.git/commitdiff
Check if $rr exists
authorHauke Zuehl <hzuehl@phone-talk.de>
Sat, 16 Jun 2012 13:07:23 +0000 (15:07 +0200)
committerHauke Zuehl <hzuehl@phone-talk.de>
Sat, 16 Jun 2012 13:07:23 +0000 (15:07 +0200)
include/config.php

index df1070c13c6b61ab5c476e5874c619a229a85f7c..60cd00cf6466bf606787a433ac4214e86b2af0f5 100644 (file)
@@ -18,9 +18,7 @@
 if(! function_exists('load_config')) {
 function load_config($family) {
        global $a;
-       $r = q("SELECT * FROM `config` WHERE `cat` = '%s'",
-               dbesc($family)
-       );
+       $r = q("SELECT * FROM `config` WHERE `cat` = '%s'", dbesc($family));
        if(count($r)) {
                foreach($r as $rr) {
                        $k = $rr['k'];
@@ -30,7 +28,7 @@ function load_config($family) {
                                $a->config[$family][$k] = $rr['v'];
                        }
                }
-       } else if ($rr['cat'] != 'config') {
+       } else if (isset($rr) && ($rr['cat'] != 'config')) {
                // Negative caching
                $a->config[$family] = "!<unset>!";
        }