fix: forever loop in golem (#3114)

This commit is contained in:
Dag 2022-10-25 14:30:01 +02:00 committed by GitHub
parent 05f2fb5ec7
commit cf7896aeef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,7 +69,15 @@ class GolemBridge extends FeedExpander
$item['content'] ??= ''; $item['content'] ??= '';
$uri = $item['uri']; $uri = $item['uri'];
$urls = [];
while ($uri) { while ($uri) {
if (isset($urls[$uri])) {
// Prevent forever a loop
break;
}
$urls[$uri] = true;
$articlePage = getSimpleHTMLDOMCached($uri, static::CACHE_TIMEOUT, static::HEADERS); $articlePage = getSimpleHTMLDOMCached($uri, static::CACHE_TIMEOUT, static::HEADERS);
// URI without RSS feed reference // URI without RSS feed reference