From 0f0e1c5425a6df8f76efc464fe90cb5abf399770 Mon Sep 17 00:00:00 2001 From: Paul van Schayck Date: Mon, 27 Dec 2004 05:16:33 +0000 Subject: [PATCH] Fix vote form and check on userinput (making more user friendly at the same time) --- include/vote.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/vote.php b/include/vote.php index b9dd8c8..855df48 100644 --- a/include/vote.php +++ b/include/vote.php @@ -146,7 +146,7 @@ function vote_menu() $m->add(""); $m->add(""); - $m->addmisc(""); + $m->addmisc(""); $m->add("View Results", BASE."votestats.php"); $m->add("Voting Help", BASE."help/?topic=voting"); @@ -175,7 +175,13 @@ function vote_update($vars) dump($vars); echo "
\n"; - + + if( !is_numeric($vars['appId']) OR !is_numeric($vars['slot'])) + { + addmsg("No application or vote slot selected", "red"); + return; + } + if($vars["vote"]) { addmsg("Registered vote for App #".$vars["appId"], "green"); @@ -185,7 +191,7 @@ function vote_update($vars) if($vars["clear"]) { addmsg("Removed vote for App #".$vars["appId"], "green"); - vote_remove($vars["appId"], $vars["slot"]); + vote_remove($vars["appId"], $vars["slot"]); } }