mirror of
https://github.com/friendica/friendica
synced 2025-04-30 21:44:22 +02:00
Avoid HTML parsing of an empty body
This commit is contained in:
parent
3e2fa7867c
commit
5a00902e11
7 changed files with 26 additions and 9 deletions
|
@ -439,6 +439,9 @@ class Probe
|
|||
}
|
||||
|
||||
$body = $curlResult->getBody();
|
||||
if (empty($body)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@$doc->loadHTML($body);
|
||||
|
@ -1274,7 +1277,7 @@ class Probe
|
|||
return [];
|
||||
}
|
||||
$content = $curlResult->getBody();
|
||||
if (!$content) {
|
||||
if (empty($content)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -1610,7 +1613,7 @@ class Probe
|
|||
private static function pumpioProfileData($profile_link)
|
||||
{
|
||||
$curlResult = DI::httpRequest()->get($profile_link);
|
||||
if (!$curlResult->isSuccess()) {
|
||||
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue