From ff84c3ab9063ca0f1934a727cf7d53023d37852c Mon Sep 17 00:00:00 2001 From: Mynacol Date: Thu, 28 Aug 2025 22:07:00 +0000 Subject: [PATCH] [GolemBridge] Fix relative links By always changing them to absolute ones. --- bridges/GolemBridge.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bridges/GolemBridge.php b/bridges/GolemBridge.php index 6c5d3c28..81f1704c 100644 --- a/bridges/GolemBridge.php +++ b/bridges/GolemBridge.php @@ -72,16 +72,18 @@ class GolemBridge extends FeedExpander while ($uri) { if (isset($urls[$uri])) { - // Prevent forever a loop + // Prevent loop in navigation links break; } $urls[$uri] = true; $articlePage = getSimpleHTMLDOMCached($uri, static::CACHE_TIMEOUT, static::HEADERS); + $articlePage = defaultLinkTo($articlePage, $uri); // URI without RSS feed reference $item['uri'] = $articlePage->find('head meta[name="twitter:url"]', 0)->content; + // extract categories if (!array_key_exists('categories', $item)) { $categories = $articlePage->find('div.go-tag-list__tags a.go-tag'); foreach ($categories as $category) { @@ -97,11 +99,7 @@ class GolemBridge extends FeedExpander // next page $nextUri = $articlePage->find('li.go-pagination__item--next>a', 0); if ($nextUri) { - $nextUri = $nextUri->href; - if (str_starts_with($nextUri, '/')) { - $nextUri = substr($nextUri, 1); - } - $uri = static::URI . $nextUri; + $uri = $nextUri->href; } else { $uri = null; }