Remove duplicates in a better way
This commit is contained in:
parent
4e7aa33598
commit
45b747f13b
|
@ -154,25 +154,19 @@ class UserItem
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the profile if it wasn't already added
|
// Add the profile
|
||||||
if (!in_array($profile, $profiles)) {
|
$profiles[] = $profile;
|
||||||
$profiles[] = $profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the normalized form
|
// Add the normalized form
|
||||||
$profile = Strings::normaliseLink($profile);
|
$profile = Strings::normaliseLink($profile);
|
||||||
if (!in_array($profile, $profiles)) {
|
$profiles[] = $profile;
|
||||||
$profiles[] = $profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the SSL form
|
// Add the SSL form
|
||||||
$profile = str_replace('http://', 'https://', $profile);
|
$profile = str_replace('http://', 'https://', $profile);
|
||||||
if (!in_array($profile, $profiles)) {
|
$profiles[] = $profile;
|
||||||
$profiles[] = $profile;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $profiles;
|
return array_unique($profiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue