From: Brion Vibber Date: Tue, 12 Jan 2010 20:26:08 +0000 (-0800) Subject: Avoid PHP notice when outputting API data for remote users; no $user means no $user... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b10e359fea9d6aabc5ab35557954a503bea730b;p=quix0rs-gnu-social.git Avoid PHP notice when outputting API data for remote users; no $user means no $user->timezone :) Trying to get property of non-object (/srv/com.leuksman.status/lib/api.php:171) --- diff --git a/lib/api.php b/lib/api.php index d21851d503..707e4ac21a 100644 --- a/lib/api.php +++ b/lib/api.php @@ -168,7 +168,7 @@ class ApiAction extends Action $timezone = 'UTC'; - if ($user->timezone) { + if (!empty($user) && $user->timezone) { $timezone = $user->timezone; }