Use new function for validity check
This commit is contained in:
parent
35d8b078ce
commit
2d4a3f482b
|
@ -132,7 +132,7 @@ function network_init(App $a)
|
||||||
DI::page()['aside'] = '';
|
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];
|
$accounttype = $a->argv[1];
|
||||||
} else {
|
} else {
|
||||||
$accounttype = '';
|
$accounttype = '';
|
||||||
|
|
|
@ -106,7 +106,7 @@ class User
|
||||||
* Returns the numeric account type by their string
|
* Returns the numeric account type by their string
|
||||||
*
|
*
|
||||||
* @param string $accounttype as string constant
|
* @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)
|
public static function getAccountTypeByString(string $accounttype)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user