diff --git a/index.php b/index.php index a9e4f84..fcbc9dc 100644 --- a/index.php +++ b/index.php @@ -634,11 +634,10 @@ function newsletterData(array $config, bool $testMode = false): array [$start, $end, $periodLabel, $periodKey] = newsletterPeriod($config['period_mode']); $allArticles = fetchLatestArticles($config['wiki_url'], (int)$config['article_fetch_limit']); + // Testversand nutzt denselben Zeitraum wie der Liveversand. + $articles = filterArticlesForPeriod($allArticles, $start, $end, (int)$config['article_limit']); if ($testMode) { - $articles = array_slice($allArticles, 0, (int)$config['article_limit']); $periodKey = 'test-' . date('Y-m-d-H-i-s'); - } else { - $articles = filterArticlesForPeriod($allArticles, $start, $end, (int)$config['article_limit']); } return [$articles, $periodLabel, $periodKey]; diff --git a/wiki.php b/wiki.php index 2b6b2a9..a54eecc 100644 --- a/wiki.php +++ b/wiki.php @@ -635,12 +635,10 @@ function newsletterData(array $config, bool $testMode = false): array [$start, $end, $periodLabel, $periodKey] = newsletterPeriod($config['period_mode']); $allArticles = fetchLatestArticles($config['wiki_url'], (int)$config['article_fetch_limit']); + // Testversand nutzt denselben Zeitraum wie der Liveversand. + $articles = filterArticlesForPeriod($allArticles, $start, $end, (int)$config['article_limit']); if ($testMode) { - $articles = array_slice($allArticles, 0, (int)$config['article_limit']); - $periodLabel = 'aktuelle Übersicht'; $periodKey = 'test-' . date('Y-m-d-H-i-s'); - } else { - $articles = filterArticlesForPeriod($allArticles, $start, $end, (int)$config['article_limit']); } return [$articles, $periodLabel, $periodKey];