mirror of
https://github.com/friendica/friendica
synced 2025-04-22 07:10:24 +00:00
Reduce probing / handle exception for invalid url / always check for https
This commit is contained in:
parent
ae7001ebde
commit
ab06d1964c
3 changed files with 30 additions and 18 deletions
|
@ -2124,7 +2124,12 @@ class BBCode
|
|||
}
|
||||
|
||||
$parts['host'] = idn_to_ascii(urldecode($parts['host']));
|
||||
return (string)Uri::fromParts($parts);
|
||||
try {
|
||||
return (string)Uri::fromParts($parts);
|
||||
} catch (\Throwable $th) {
|
||||
Logger::notice('Exception on unparsing url', ['url' => $url, 'parts' => $parts, 'code' => $th->getCode(), 'message' => $th->getMessage()]);
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
|
||||
private static function unifyLinks(string $text): string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue