[VkBridge] Remove double backslashes in feed item link

This commit is contained in:
Eugene Molotov 2018-03-17 13:59:14 +05:00
parent ca77295c80
commit e29cd8fd1a

View File

@ -71,7 +71,13 @@ class VkBridge extends BridgeAbstract
} }
// get post link // 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['timestamp'] = $this->getTime($post);
$item['title'] = $this->getTitle($item['content']); $item['title'] = $this->getTitle($item['content']);
$item['author'] = $pageName; $item['author'] = $pageName;