From 50b234d89349669868f057d7c6884c2068f6a745 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Tue, 17 Sep 2019 00:30:27 +0500 Subject: [PATCH] [VkBridge] Photo and timestamp fixes (#1287) * [VkBridge] Correct parsing of photos, fix timestamp for old posts --- bridges/VkBridge.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php index 1763844e..ff0eab7f 100644 --- a/bridges/VkBridge.php +++ b/bridges/VkBridge.php @@ -167,7 +167,7 @@ class VkBridge extends BridgeAbstract } // get all photos - foreach($post->find('div.wall_text > a.page_post_thumb_wrap') as $a) { + foreach($post->find('div.wall_text a.page_post_thumb_wrap') as $a) { $result = $this->getPhoto($a); if ($result == null) continue; $a->outertext = ''; @@ -356,6 +356,8 @@ class VkBridge extends BridgeAbstract } $date = date_parse($strdate); + } elseif ($date['hour'] === false) { + $date['hour'] = $date['minute'] = '00'; } return strtotime($date['day'] . '-' . $date['month'] . '-' . $date['year'] . ' ' . $date['hour'] . ':' . $date['minute']);