]> git.mxchange.org Git - friendica.git/commitdiff
Remove duplicates in a better way
authorMichael <heluecht@pirati.ca>
Sun, 5 Jan 2020 13:05:00 +0000 (13:05 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 5 Jan 2020 13:05:00 +0000 (13:05 +0000)
src/Model/UserItem.php

index ab81be5e4cae15594dde4d9e70286837d874b264..fb89a9bc503e04f08d94a126bbaf314db434d58d 100644 (file)
@@ -154,25 +154,19 @@ class UserItem
                                continue;
                        }
 
-                       // Add the profile if it wasn't already added
-                       if (!in_array($profile, $profiles)) {
-                               $profiles[] = $profile;
-                       }
+                       // Add the profile
+                       $profiles[] = $profile;
 
                        // Add the normalized form
                        $profile = Strings::normaliseLink($profile);
-                       if (!in_array($profile, $profiles)) {
-                               $profiles[] = $profile;
-                       }
+                       $profiles[] = $profile;
 
                        // Add the SSL form
                        $profile = str_replace('http://', 'https://', $profile);
-                       if (!in_array($profile, $profiles)) {
-                               $profiles[] = $profile;
-                       }
+                       $profiles[] = $profile;
                }
 
-               return $profiles;
+               return array_unique($profiles);
        }
 
        /**