Improved check for invalid profiles
This commit is contained in:
parent
4dec002dcb
commit
31b6680402
1 changed files with 2 additions and 4 deletions
|
@ -148,10 +148,8 @@ class UserItem
|
||||||
|
|
||||||
// Validate and add profile links
|
// Validate and add profile links
|
||||||
foreach ($profiles AS $key => $profile) {
|
foreach ($profiles AS $key => $profile) {
|
||||||
// Check for invalid profile urls. 13 should be the shortest possible profile length:
|
// Check for invalid profile urls (without scheme, host or path) and remove them
|
||||||
// http://a.bc/d
|
if (empty(parse_url($profile, PHP_URL_SCHEME)) || empty(parse_url($profile, PHP_URL_HOST)) || empty(parse_url($profile, PHP_URL_PATH))) {
|
||||||
// Additionally check for invalid urls that would return the normalised value "http:"
|
|
||||||
if ((strlen($profile) < 13) || (Strings::normaliseLink($profile) == 'http:')) {
|
|
||||||
unset($profiles[$key]);
|
unset($profiles[$key]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue