X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=fdf0fa3aa733428504d265abf41be9c49ef79017;hb=5a439a31f3ef58b826ffe21c8972d6373165b8bb;hp=4b2e83f18a5eff74d1913b3186c43e26976fb820;hpb=be3fa8f8b13de647ab14a3ffceba08913c9eab73;p=friendica.git diff --git a/boot.php b/boot.php index 4b2e83f18a..fdf0fa3aa7 100644 --- a/boot.php +++ b/boot.php @@ -1047,11 +1047,21 @@ class App { function save_timestamp($stamp, $value) { $duration = (float)(microtime(true)-$stamp); + if (!isset($this->performance[$value])) { + // Prevent ugly E_NOTICE + $this->performance[$value] = 0; + } + $this->performance[$value] += (float)$duration; $this->performance["marktime"] += (float)$duration; $callstack = $this->callstack(); + if (!isset($this->callstack[$value][$callstack])) { + // Prevent ugly E_NOTICE + $this->callstack[$value][$callstack] = 0; + } + $this->callstack[$value][$callstack] += (float)$duration; } @@ -1839,7 +1849,8 @@ function load_contact_links($uid) { $r = q("SELECT `id`,`network`,`url`,`thumb`, `rel` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `thumb` != ''", intval($uid) ); - if(count($r)) { + + if(is_filled_array($r)) { foreach($r as $rr){ $url = normalise_link($rr['url']); $ret[$url] = $rr; @@ -2139,3 +2150,7 @@ function argv($x) { return ''; } + +function is_filled_array ($array) { + return (is_array($array) && count($array) > 0); +}