mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Merge pull request #14734 from MrPetovan/bug/empty-dom-string
Ward against empty string in Model\Item::replacePlatformIcon
This commit is contained in:
commit
5a00a2c441
1 changed files with 8 additions and 0 deletions
|
@ -3498,6 +3498,10 @@ class Item
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($shared_item['uri-id'])) {
|
if (!empty($shared_item['uri-id'])) {
|
||||||
|
if (!$s) {
|
||||||
|
DI::logger()->notice('Unexpected empty item HTML', ['item' => $item]);
|
||||||
|
}
|
||||||
|
|
||||||
$s = self::replacePlatformIcon($s, $shared_item, $uid);
|
$s = self::replacePlatformIcon($s, $shared_item, $uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3574,6 +3578,10 @@ class Item
|
||||||
*/
|
*/
|
||||||
private static function replacePlatformIcon(string $html, array $item, int $uid): string
|
private static function replacePlatformIcon(string $html, array $item, int $uid): string
|
||||||
{
|
{
|
||||||
|
if ($html === '') {
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
if (!@$dom->loadHTML($html)) {
|
if (!@$dom->loadHTML($html)) {
|
||||||
return $html;
|
return $html;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue