From 1d8da74b77b01295e472e0258849e0d58eb079b3 Mon Sep 17 00:00:00 2001 From: Paul van Schayck Date: Sun, 2 Jan 2005 22:08:00 +0000 Subject: [PATCH] Use a more simple check for the arguments --- votestats.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/votestats.php b/votestats.php index 8b31702..fb996ce 100644 --- a/votestats.php +++ b/votestats.php @@ -15,14 +15,13 @@ $topNumber = 25; $categoryId = "any"; /* default to all categories */ /* process the post variables to override the default settings */ -if($_POST) -{ - if(isset($_POST['topNumber'])) $topNumber = (int)mysql_real_escape_string($_POST['topNumber']); - if(isset($_POST['categoryId'])) $categoryId = mysql_real_escape_string($_POST['categoryId']); -} +if( isset($_REQUEST['topNumber']) AND is_numeric($_REQUEST['topNumber'])) + $topNumber = $_REQUEST['topNumber']; +if( isset($_REQUEST['categoryId']) AND is_numeric($_REQUEST['categoryId'])) + $categoryId = $_REQUEST['categoryId']; /* Check if the value makes sense */ -if(!is_integer($topNumber) || $topNumber > 200 || $topNumber < 1) +if($topNumber > 200 || $topNumber < 1) $topNumber = 25; apidb_header("Vote Stats - Top $topNumber Applications");