From dd1dff2be02329bf557a5af4653976b115d88ba2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 11 May 2022 18:20:05 +0200 Subject: [PATCH] url selection layout --- attachment.sh | 6 ++---- index.cgi | 11 ++++------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/attachment.sh b/attachment.sh index 1981973..3b6e6c5 100755 --- a/attachment.sh +++ b/attachment.sh @@ -117,7 +117,7 @@ elif [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then else theme_404 fi - exit 0; +# exit 0; elif [ "${PATH_INFO%/}" = "${PATH_INFO}" ]; then attpath="${PATH_INFO%/*}/#attachments/${PATH_INFO##*/}" @@ -130,9 +130,7 @@ elif [ "${PATH_INFO%/}" = "${PATH_INFO}" ]; then FILE "$(attachment_convert "$_EXEC/pages/$attpath")" elif [ -d "$_DATA/pages/${PATH_INFO}" -o -d "$_EXEC/pages/${PATH_INFO}" ]; then REDIRECT "${_BASE}${PATH_INFO}/" - else + elif [ "${PATH_INFO%\[*\]}" = "${PATH_INFO}" ]; then theme_404 fi - exit 0 - fi diff --git a/index.cgi b/index.cgi index 90f7d77..465a989 100755 --- a/index.cgi +++ b/index.cgi @@ -74,23 +74,20 @@ case "${PATH_INFO}" in /"[.]"/*) FILE "${_EXEC}/${PATH_INFO#/\[.\]}" ;; - */\[*\]/) :;; - */) + /|*[^]]/) theme_page "${PATH_INFO}" - exit 0 ;; */"[login]") theme_login - exit 0 ;; */"[register]") theme_register - exit 0 ;; */"#"*) : # TODO: Invalid page name ;; + *) + . "$_EXEC/page_edit.sh" + . "$_EXEC/attachment.sh" esac -. "$_EXEC/page_edit.sh" -. "$_EXEC/attachment.sh" -- 2.39.2