Quote:
Originally Posted by Soup
In the Warning System (v3.1.9) in Warn.php, on line 332 you are running a potentially unsafe query (for example if a user enters a non-numerical input as the id variable). If you enter a string that doesn't start with a number (such as "foo") as the id the code will catch the problem on line 328-330, however if the string entered starts with a number (such as "3foo") then it will pass through the check fine.
In order to fix this:
Before line 328-330 add:
PHP Code:
$_GET['id'] = intval($_GET['id']);
or globalize the variable:
PHP Code:
globalize($_GET,array('id' => INT));
and then you use $id instead of $_GET['id'].
|
Soup,
Thanks for the details, much appreciated. I have already been working on this, since this morning, and I have globalized all the _GET or _POST variables. But I was not aware that you can use kist $id instead of $_GET['id']
So any variable entered in the globalize function, can then be used with the part withing the brackets, that's what I figure out from looking at the globalize code. Am I correct? And how do you differentiate if you have a _GET['do'] and a _POST['do']?
Also, for STR variables, except from globalizing them (maybe using STR_NOHTML), is it also necessary to addslashes to them?
Again, thanks for the input, sincerely appreciated.