]> git.plutz.net Git - webpoll/blobdiff - poll.sh
keep invalid URLs intact in case of typo
[webpoll] / poll.sh
diff --git a/poll.sh b/poll.sh
index de5b614c74321c93521a6ac0e1bb3c2e08f45d05..bb5bc8db1d213dc0b46d3bdebacfe5a24d257c3f 100644 (file)
--- a/poll.sh
+++ b/poll.sh
@@ -4,7 +4,10 @@ id="$(checkid "${PATH_INFO#/}")"
 file="${_DATA}/${id}"
 
 #cancel if poll is invalid
-[ "$id" -a -f "$file" ] || REDIRECT "$_BASE/"
+if [ ! "$id" -o ! -f "$file" ]; then
+  page_home;
+  return 0
+fi
 
 if expr match "$bookmarks" ".*${id}.*" >/dev/null; then
   :