Use a more simple check for the arguments

This commit is contained in:
Paul van Schayck
2005-01-02 22:08:00 +00:00
committed by WineHQ
parent ae3b27acf6
commit 1d8da74b77

View File

@@ -15,14 +15,13 @@ $topNumber = 25;
$categoryId = "any"; /* default to all categories */ $categoryId = "any"; /* default to all categories */
/* process the post variables to override the default settings */ /* process the post variables to override the default settings */
if($_POST) if( isset($_REQUEST['topNumber']) AND is_numeric($_REQUEST['topNumber']))
{ $topNumber = $_REQUEST['topNumber'];
if(isset($_POST['topNumber'])) $topNumber = (int)mysql_real_escape_string($_POST['topNumber']); if( isset($_REQUEST['categoryId']) AND is_numeric($_REQUEST['categoryId']))
if(isset($_POST['categoryId'])) $categoryId = mysql_real_escape_string($_POST['categoryId']); $categoryId = $_REQUEST['categoryId'];
}
/* Check if the value makes sense */ /* Check if the value makes sense */
if(!is_integer($topNumber) || $topNumber > 200 || $topNumber < 1) if($topNumber > 200 || $topNumber < 1)
$topNumber = 25; $topNumber = 25;
apidb_header("Vote Stats - Top $topNumber Applications"); apidb_header("Vote Stats - Top $topNumber Applications");