mirror of
https://github.com/friendica/friendica
synced 2025-05-22 03:44:13 +02:00
Catch TransferExceptions for HTTPClient::finalUrl() in case the headers are empty
This commit is contained in:
parent
e88c12d958
commit
b76634ea0c
3 changed files with 11 additions and 3 deletions
|
@ -42,6 +42,7 @@ use Friendica\Util\ParseUrl;
|
|||
use Friendica\Util\Proxy;
|
||||
use Friendica\Util\Strings;
|
||||
use Friendica\Util\XML;
|
||||
use GuzzleHttp\Exception\TransferException;
|
||||
|
||||
/**
|
||||
* This class contain functions to import feeds (RSS/RDF/Atom)
|
||||
|
@ -297,7 +298,11 @@ class Feed
|
|||
|
||||
$orig_plink = $item["plink"];
|
||||
|
||||
$item["plink"] = DI::httpClient()->finalUrl($item["plink"]);
|
||||
try {
|
||||
$item["plink"] = DI::httpClient()->finalUrl($item["plink"]);
|
||||
} catch (TransferException $exception) {
|
||||
Logger::notice('Item URL couldn\'t get expanded', ['url' => $item["plink"], 'exception' => $exception]);
|
||||
}
|
||||
|
||||
$item["title"] = XML::getFirstNodeValue($xpath, 'atom:title/text()', $entry);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue