]> git.mxchange.org Git - friendica.git/commitdiff
Use new function for validity check
authorMichael <heluecht@pirati.ca>
Sat, 10 Oct 2020 07:14:43 +0000 (07:14 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 10 Oct 2020 07:14:43 +0000 (07:14 +0000)
mod/network.php
src/Model/User.php

index 57e4a2ada25a36b52facd04aca883744001461ed..ef6b0b324e2aa123b73a6a90667af8cd788e927f 100644 (file)
@@ -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 = '';
index af70c420e6b2b3baf49f7134fcca1769391c49cc..68c42e40e093f2d3c9219609d06f626eb101c3d9 100644 (file)
@@ -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)
        {