[VkBridge] Handle empty posts before fixing image links (#3052)

This commit is contained in:
Eugene Molotov 2022-09-20 21:07:57 +05:00 committed by GitHub
parent 6cd8b90d28
commit 2db523a37a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -297,6 +297,9 @@ class VkBridge extends BridgeAbstract
$item = []; $item = [];
$content = strip_tags(backgroundToImg($post->find('div.wall_text', 0)->innertext), '<a><br><img>'); $content = strip_tags(backgroundToImg($post->find('div.wall_text', 0)->innertext), '<a><br><img>');
$content .= $content_suffix; $content .= $content_suffix;
if (!$content) {
$content = '(empty post)';
}
$content = str_get_html($content); $content = str_get_html($content);
foreach ($content->find('img') as $img) { foreach ($content->find('img') as $img) {
$parsed_src = parse_url($img->getAttribute('src')); $parsed_src = parse_url($img->getAttribute('src'));