From 1baf2f76c999e9dbcd296197e279fdd0db709f5b Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 8 Oct 2024 17:52:30 +0200 Subject: [PATCH] limit to .md files --- common.php | 4 ++-- index.php | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/common.php b/common.php index 9eede57..44aaada 100644 --- a/common.php +++ b/common.php @@ -124,11 +124,11 @@ session_start(); if (!isset($_SESSION['index']) || isset($_GET['reindex']) || empty($_SESSION['index'])) { - $files = glob($dir . '/*'); + $files = glob($dir . '/*.md'); usort($files, function($a, $b) { return filemtime($b) - filemtime($a); }); $_SESSION['index'] = array_map(fn($value): string => str_replace('.md', '', $value), $files); } -?> \ No newline at end of file +?> diff --git a/index.php b/index.php index 8f0d12d..081202c 100644 --- a/index.php +++ b/index.php @@ -39,10 +39,6 @@ foreach($_SESSION['index'] as $path) { $name = basename($path); - if (str_ends_with($name, '.del')) - { - continue; - } if ($filter) { @@ -64,4 +60,4 @@ ?> - \ No newline at end of file +