From 31b66804024f5b27e4dc2ce8d1c15ed0e9645a63 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 Jan 2020 13:19:11 +0000 Subject: [PATCH] Improved check for invalid profiles --- src/Model/UserItem.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Model/UserItem.php b/src/Model/UserItem.php index 03e7f51f64..15c7730054 100644 --- a/src/Model/UserItem.php +++ b/src/Model/UserItem.php @@ -148,10 +148,8 @@ class UserItem // Validate and add profile links foreach ($profiles AS $key => $profile) { - // Check for invalid profile urls. 13 should be the shortest possible profile length: - // http://a.bc/d - // Additionally check for invalid urls that would return the normalised value "http:" - if ((strlen($profile) < 13) || (Strings::normaliseLink($profile) == 'http:')) { + // Check for invalid profile urls (without scheme, host or path) and remove them + if (empty(parse_url($profile, PHP_URL_SCHEME)) || empty(parse_url($profile, PHP_URL_HOST)) || empty(parse_url($profile, PHP_URL_PATH))) { unset($profiles[$key]); continue; }