diff --git a/html/inc/user.inc b/html/inc/user.inc index 5c22c3dc61..6586a82f96 100644 --- a/html/inc/user.inc +++ b/html/inc/user.inc @@ -79,8 +79,8 @@ function get_other_projects($user) { // $remote = @json_decode(json_encode((array)$xml_object))->project; if (!$remote) $remote = []; - if (count($remote) == 1) { - $remote = array($remote); + if (!is_array($remote)) { + $remote = [$remote]; } // Cache the results diff --git a/html/inc/util.inc b/html/inc/util.inc index ba93dc44e3..6b169beb31 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -1024,6 +1024,7 @@ function sanitize_local_url($x) { // strip HTML tags // function sanitize_tags($x) { + if (!$x) return $x; return strip_tags($x); }