From 50162f52b6da6d8fbd6785803250a4a975417f8e Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Tue, 2 Jul 2019 21:39:51 +0200 Subject: [PATCH] [XenForoBridge] Fix minor issues with CSS selectors --- bridges/XenForoBridge.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bridges/XenForoBridge.php b/bridges/XenForoBridge.php index ac9cdd5b91b..983654e1d84 100644 --- a/bridges/XenForoBridge.php +++ b/bridges/XenForoBridge.php @@ -127,7 +127,7 @@ public function collectData() { switch($this->version) { case self::XENFORO_VERSION_1: - $titleBar = $mainContent->find('div.titleBar h1', 0) + $titleBar = $mainContent->find('div.titleBar > h1', 0) or returnServerError('Error finding title bar!'); $this->title = $titleBar->plaintext; @@ -166,7 +166,7 @@ private function extractThreadPostsV1($html, $url) { $lang = $html->find('html', 0)->lang; // Posts are contained in an "ol" - $messageList = $html->find('#messageList li') + $messageList = $html->find('#messageList > li') or returnServerError('Error finding message list!'); foreach($messageList as $post) { @@ -179,7 +179,7 @@ private function extractThreadPostsV1($html, $url) { $item['uri'] = $url . '#' . $post->getAttribute('id'); - $content = $post->find('.messageContent article', 0); + $content = $post->find('.messageContent > article', 0); // Add some style to quotes foreach($content->find('.bbCodeQuote') as $quote) { @@ -343,7 +343,7 @@ private function extractPagesV2($html) { } // Manually extract baseurl and inject sentinel - $baseurl = $pageNav->find('li a', -1)->href; + $baseurl = $pageNav->find('li > a', -1)->href; $baseurl = str_replace('page-' . $lastpage, 'page-{{sentinel}}', $baseurl); $sentinel = '{{sentinel}}';