X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=handlers%2F10_page.sh;h=334df197d9694f72dfd8ccdfbc7c4fba69a96feb;hb=03faace5d5ef48267bfd0108edf65b29f285b2ac;hp=70e70e7fa75a0e8fd4e48ddb399c0fb8dcf342da;hpb=c8859c13ff211e074f25b618bf4ddd841baacd6e;p=shellwiki diff --git a/handlers/10_page.sh b/handlers/10_page.sh index 70e70e7..334df19 100755 --- a/handlers/10_page.sh +++ b/handlers/10_page.sh @@ -7,14 +7,6 @@ export WIKI_THEME=${WIKI_THEME:-default} . "$_EXEC/themes/${WIKI_THEME}.sh" -if [ "$(which awk)" ]; then - md() { awk -f "$_EXEC/md_macros.awk" -f "$_EXEC/cgilite/markdown.awk"; } -elif [ "$(which busybox)" ]; then - md() { busybox awk -f "$_EXEC/md_macros.awk" -f "$_EXEC/cgilite/markdown.awk"; } -else - md() { cat; } -fi - wiki() { # Print content of a wiki page # Get page from data or underlay dir, handle caching @@ -48,6 +40,11 @@ case "${PATH_INFO}" in FILE "${_EXEC}/${PATH_INFO#/\[.\]}" return 0 ;; + *${BR}*) + export ERROR_MSG='Page names containing newline character are not allowed' + theme_error 400 + return 0 + ;; */\#*) export ERROR_MSG='Page names starting with "#" are not allowed' theme_error 400 @@ -56,18 +53,6 @@ case "${PATH_INFO}" in */\[*\]/*) return 1 ;; - */"[login]") - theme_page "/[wiki]/login/" - return 0 - ;; - */"[register]") - theme_page "/[wiki]/register/" - return 0 - ;; - */"[invite]") - theme_page "/[wiki]/invite/" - return 0 - ;; */) theme_page "${PATH_INFO}" return 0