From f7ddbcd7335e3879c13035e98b1a40c32ff5a710 Mon Sep 17 00:00:00 2001
From: ORelio <ORelio@users.noreply.github.com>
Date: Sun, 28 Jul 2024 21:58:08 +0200
Subject: [PATCH] [GBAtemp] Fix title extraction (#4151)

Fix title extraction for news and reviews
---
 bridges/GBAtempBridge.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bridges/GBAtempBridge.php b/bridges/GBAtempBridge.php
index 4aa04799..361e3f1d 100644
--- a/bridges/GBAtempBridge.php
+++ b/bridges/GBAtempBridge.php
@@ -31,7 +31,7 @@ class GBAtempBridge extends BridgeAbstract
                     $img = $this->findItemImage($newsItem, 'a.news_image');
                     $time = $this->findItemDate($newsItem);
                     $author = $newsItem->find('a.username', 0)->plaintext;
-                    $title = $this->decodeHtmlEntities($newsItem->find('h3.news_title', 0)->plaintext);
+                    $title = $this->decodeHtmlEntities($newsItem->find('h2.news_title', 0)->plaintext);
                     $content = $this->fetchPostContent($url, self::URI);
                     $this->items[] = $this->buildItem($url, $title, $author, $time, $img, $content);
                     unset($newsItem); // Some items are heavy, freeing the item proactively helps saving memory
@@ -41,7 +41,7 @@ class GBAtempBridge extends BridgeAbstract
                 foreach ($html->find('li.portal_review') as $reviewItem) {
                     $url = urljoin(self::URI, $reviewItem->find('a.review_boxart', 0)->href);
                     $img = $this->findItemImage($reviewItem, 'a.review_boxart');
-                    $title = $this->decodeHtmlEntities($reviewItem->find('h2.review_title', 0)->plaintext);
+                    $title = $this->decodeHtmlEntities($reviewItem->find('div.review_title', 0)->find('h2', 0)->plaintext);
                     $content = getSimpleHTMLDOMCached($url);
                     $author = $content->find('span.author--name', 0)->plaintext;
                     $time = $this->findItemDate($content);