From 65ea9f6e3074c98514990c9018fe605e8fbea954 Mon Sep 17 00:00:00 2001 From: smueller Date: Tue, 7 Jul 2026 10:47:11 +0200 Subject: [PATCH] Improve article fetching logic in index.php by adding a check for DOMElement instances. Clean up newsletter HTML by removing outdated text and logo image for a more streamlined presentation. --- index.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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 - - - - - -