mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-12-22 13:10:20 +00:00
Merge pull request 'Bluesky: Fix for the handling of invalid profiles' (#1553) from heluecht/friendica-addons:bluesky-fix into develop
Reviewed-on: https://git.friendi.ca/friendica/friendica-addons/pulls/1553
This commit is contained in:
commit
956233ff1d
1 changed files with 8 additions and 1 deletions
|
@ -1765,9 +1765,16 @@ function bluesky_get_did_by_profile(string $url): string
|
|||
return '';
|
||||
}
|
||||
$profile = $curlResult->getBodyString();
|
||||
if (empty($profile)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@$doc->loadHTML($profile);
|
||||
try {
|
||||
@$doc->loadHTML($profile);
|
||||
} catch (\Throwable $th) {
|
||||
return '';
|
||||
}
|
||||
$xpath = new DOMXPath($doc);
|
||||
$list = $xpath->query('//p[@id]');
|
||||
foreach ($list as $node) {
|
||||
|
|
Loading…
Reference in a new issue