mirror of
https://github.com/friendica/friendica
synced 2025-04-28 11:04:22 +02:00
Fixes "Invalid URL for photo" for photos without host
This commit is contained in:
parent
ac469742b1
commit
f455f7e7d1
2 changed files with 15 additions and 13 deletions
|
@ -29,6 +29,7 @@ use Friendica\Core\System;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Protocol\ActivityNamespace;
|
||||
|
@ -358,12 +359,12 @@ class APContact
|
|||
$apcontact['discoverable'] = JsonLD::fetchElement($compacted, 'toot:discoverable', '@value');
|
||||
|
||||
if (!empty($apcontact['photo'])) {
|
||||
$apcontact['photo'] = trim($apcontact['photo']);
|
||||
}
|
||||
$apcontact['photo'] = Network::addBasePath($apcontact['photo'], $apcontact['url']);
|
||||
|
||||
if (!empty($apcontact['photo']) && !Network::isValidHttpUrl($apcontact['photo'])) {
|
||||
Logger::warning('Invalid URL for photo', ['url' => $apcontact['url'], 'photo' => $apcontact['photo']]);
|
||||
$apcontact['photo'] = '';
|
||||
if (!Network::isValidHttpUrl($apcontact['photo'])) {
|
||||
Logger::warning('Invalid URL for photo', ['url' => $apcontact['url'], 'photo' => $apcontact['photo']]);
|
||||
$apcontact['photo'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
// When the photo is too large, try to shorten it by removing parts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue