From 2db523a37a37f0cf5e9ea7dddf710f67e77b41d4 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Tue, 20 Sep 2022 21:07:57 +0500 Subject: [PATCH] [VkBridge] Handle empty posts before fixing image links (#3052) --- bridges/VkBridge.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php index 89380963..a23c681c 100644 --- a/bridges/VkBridge.php +++ b/bridges/VkBridge.php @@ -297,6 +297,9 @@ class VkBridge extends BridgeAbstract $item = []; $content = strip_tags(backgroundToImg($post->find('div.wall_text', 0)->innertext), '
'); $content .= $content_suffix; + if (!$content) { + $content = '(empty post)'; + } $content = str_get_html($content); foreach ($content->find('img') as $img) { $parsed_src = parse_url($img->getAttribute('src'));