From e29cd8fd1a34d048dab033d71afac98bd1ae250e Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Sat, 17 Mar 2018 13:59:14 +0500 Subject: [PATCH] [VkBridge] Remove double backslashes in feed item link --- bridges/VkBridge.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php index 423e8a26..53d791a5 100644 --- a/bridges/VkBridge.php +++ b/bridges/VkBridge.php @@ -71,7 +71,13 @@ class VkBridge extends BridgeAbstract } // get post link - $item['uri'] = self::URI . $post->find('a.post_link', 0)->getAttribute('href'); + $post_link = $post->find('a.post_link', 0)->getAttribute('href'); + if (substr(self::URI, -1) == '/') { + $post_link = self::URI . ltrim($post_link, "/"); + } else { + $post_link = self::URI . $post_link; + } + $item['uri'] = $post_link; $item['timestamp'] = $this->getTime($post); $item['title'] = $this->getTitle($item['content']); $item['author'] = $pageName;