diff --git a/index.php b/index.php index 68efb32..39746d3 100644 --- a/index.php +++ b/index.php @@ -170,6 +170,10 @@ function fetchLatestArticles(string $wikiUrl, int $limit = 150): array $nodes = $xpath->query('//li'); foreach ($nodes as $li) { + if (!$li instanceof DOMElement) { + continue; + } + $text = trim(preg_replace('/\s+/', ' ', $li->textContent ?? '')); if (!preg_match('/\((\d{2}\.\d{2}\.\d{4})\)/', $text, $dateMatch)) { @@ -443,16 +447,6 @@ function buildNewsletterHtml(array $config, array $articles, string $periodLabel - - - - - -