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)
This commit is contained in:
parent
4cc9b183d7
commit
2b10e359fe
@ -168,7 +168,7 @@ class ApiAction extends Action
|
|||||||
|
|
||||||
$timezone = 'UTC';
|
$timezone = 'UTC';
|
||||||
|
|
||||||
if ($user->timezone) {
|
if (!empty($user) && $user->timezone) {
|
||||||
$timezone = $user->timezone;
|
$timezone = $user->timezone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user