From 2d4a3f482b99ea731f65c942bb1a5d4e3bb6ce96 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Oct 2020 07:14:43 +0000 Subject: [PATCH] Use new function for validity check --- mod/network.php | 2 +- src/Model/User.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/network.php b/mod/network.php index 57e4a2ada2..ef6b0b324e 100644 --- a/mod/network.php +++ b/mod/network.php @@ -132,7 +132,7 @@ function network_init(App $a) DI::page()['aside'] = ''; } - if (!empty($a->argv[1]) && in_array($a->argv[1], ['person', 'organisation', 'news', 'community'])) { + if (!empty(User::getAccountTypeByString($a->argv[1] ?? ''))) { $accounttype = $a->argv[1]; } else { $accounttype = ''; diff --git a/src/Model/User.php b/src/Model/User.php index af70c420e6..68c42e40e0 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -106,7 +106,7 @@ class User * Returns the numeric account type by their string * * @param string $accounttype as string constant - * @return void + * @return int|null Numeric account type - or null when not set */ public static function getAccountTypeByString(string $accounttype) {