From be92c87c4ce7e1224843d684e41df33c84c77cf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 20 Jul 2023 11:47:21 +0200 Subject: [PATCH] fix page creation in the absence of page name --- handlers/60_newpage.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/handlers/60_newpage.sh b/handlers/60_newpage.sh index f3cbde7..42eed3f 100755 --- a/handlers/60_newpage.sh +++ b/handlers/60_newpage.sh @@ -19,8 +19,15 @@ template="$(POST template)" page="$(POST page)" if [ "$page" ]; then + # either a page name has been entered pattern="$(date +"$pattern")" page="$(printf -- "$pattern" "$page")" + +elif [ "${pattern%%"%%s"*}" = "${pattern}" ]; then + # or a page name is not part of the pattern + pattern="$(date +"$pattern")" + page="$pattern" + else printf 'Refresh: %i; url=%s\r\n' 4 ./ export ERROR_MSG="Page name required" -- 2.39.2