getPrivateCategories(); $Parsedown = new Parsedown(); $now = time(); $base = rtrim(APP_URL, '/'); $all = array_values(array_filter( $articles->getAll(publishedOnly: true), static function (array $a) use ($now, $privateCats): bool { if (strtotime((string)($a['published_at'] ?? '')) > $now) { return false; } $cat = trim($a['category'] ?? ''); return $cat === '' || !in_array($cat, $privateCats, true); } )); $total = count($all); $lastPage = max(1, (int)ceil($total / FEED_PAGE_SIZE)); $page = max(1, min($lastPage, (int)($_GET['page'] ?? 1))); $items = array_slice($all, ($page - 1) * FEED_PAGE_SIZE, FEED_PAGE_SIZE); $feedUrl = static fn (int $p): string => $base . '/feed' . ($p > 1 ? '?page=' . $p : ''); $lastBuild = ''; foreach ($all as $a) { $ts = (int)strtotime((string)($a['updated_at'] ?? $a['published_at'] ?? '')); if ($ts > (int)strtotime($lastBuild ?: '1970-01-01')) { $lastBuild = date(DATE_RSS, $ts); } } if ($lastBuild === '') { $lastBuild = date(DATE_RSS); } header('Content-Type: application/rss+xml; charset=UTF-8'); header('X-Content-Type-Options: nosniff'); echo '' . "\n"; ?> varlog Journal personnel de Cédrix — informatique, hack et loisirs techniques. fr 1): ?>