From ac6c01bd4652c236882275d0d0e8db67b8597c24 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 16 Feb 2024 18:08:18 +0100 Subject: [PATCH] change: param empty by default --- index.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/index.php b/index.php index c327458..991d1f2 100644 --- a/index.php +++ b/index.php @@ -69,16 +69,19 @@ if ($action == 'open') { - $title = $param; + if (!$param) + { + $param = date("Y-m-d H.i.s", time()); + } $content = ''; - if (!file_exists($dir . '/' . $title)) + if (!file_exists($dir . '/' . $param)) { - file_put_contents($dir . '/' . $title, $content); + file_put_contents($dir . '/' . $param, $content); } else { - $content = file_get_contents($dir . '/' . $title); + $content = file_get_contents($dir . '/' . $param); } $nblines = max(20, substr_count($content, "\r\n") + 1) * 2; @@ -92,7 +95,7 @@
-

+

@@ -100,13 +103,8 @@ } else { - $defaulttitle = date("Y-m-d H.i.s", time()); - if ($param) - { - $defaulttitle = $param; - } echo '
- +