Check for parts key existence before performing strpos in Network\Probe

- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
This commit is contained in:
Hypolite Petovan 2022-12-07 22:15:47 -05:00
parent 1622ce0a99
commit 0af2be14ee

View File

@ -684,7 +684,7 @@ class Probe
} }
$parts = parse_url($uri); $parts = parse_url($uri);
if (empty($parts['scheme']) && empty($parts['host']) && !strstr($parts['path'], '@')) { if (empty($parts['scheme']) && empty($parts['host']) && (empty($parts['path']) || strpos($parts['path'], '@') === false)) {
Logger::info('URI was not detectable', ['uri' => $uri]); Logger::info('URI was not detectable', ['uri' => $uri]);
return []; return [];
} }