Ward against empty string in Model\Item::replacePlatformIcon

- Add logger call to troubleshoot
This commit is contained in:
Hypolite Petovan 2025-01-26 11:32:41 -05:00
parent c8042e92df
commit 20ab8de06d

View file

@ -3498,6 +3498,10 @@ class Item
}
if (!empty($shared_item['uri-id'])) {
if (!$s) {
DI::logger()->notice('Unexpected empty item HTML', ['item' => $item]);
}
$s = self::replacePlatformIcon($s, $shared_item, $uid);
}
@ -3574,6 +3578,10 @@ class Item
*/
private static function replacePlatformIcon(string $html, array $item, int $uid): string
{
if ($html === '') {
return $html;
}
$dom = new \DOMDocument();
if (!@$dom->loadHTML($html)) {
return $html;