From e6a5d6ca663b118b16bec493d8b7c1f923c2d702 Mon Sep 17 00:00:00 2001 From: Uriel Date: Sat, 15 Mar 2008 21:54:24 +0100 Subject: [PATCH] New (saner?) title format, and extra input sanity check. --- bin/controller.rc | 7 ++++--- inc/headers.tpl | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/controller.rc b/bin/controller.rc index bc7df63..ad28110 100755 --- a/bin/controller.rc +++ b/bin/controller.rc @@ -1,7 +1,7 @@ #!/usr/local/plan9/bin/rc path=(. ./bin $PLAN9/bin /bin/ /usr/bin) -uri = `{echo -n $REQUEST_URI | sed 's/\?.*//; s/[^a-zA-Z0-9_+\-\/]//g'} +uri = `{echo -n $REQUEST_URI | sed -e 's/\?.*//; s/[^a-zA-Z0-9_+\-\/]//g' -e '1q'} ifs='/' { args = `{echo -n $uri} } @@ -125,8 +125,9 @@ fn genbody { . etc/initrc if (! ~ $args '') { - title=$args($#args) - title=`{echo $title | sed 's/_/ /g' } + #title=$args($#args) + title=$args + title=`{echo $title | sed -e 's/ / - /g' -e 's/_/ /g' } body=$uri } diff --git a/inc/headers.tpl b/inc/headers.tpl index 0e02bac..e7343ae 100644 --- a/inc/headers.tpl +++ b/inc/headers.tpl @@ -8,7 +8,7 @@ Content-Type: text/html - %($title '|' $site '|' $siteTitle $siteSubTitle %) + %($title '|' $siteTitle $siteSubTitle %)