Use a more simple check for the arguments
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user