1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-30 11:30:11 +02:00

[GolemBridge] Fix relative links

By always changing them to absolute ones.
This commit is contained in:
Mynacol
2025-08-28 22:07:00 +00:00
parent 1f5f7bc4ca
commit ff84c3ab90

View File

@@ -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;
}