Quote:
Originally Posted by Zero Tolerance
Just to keep that check fully functional:
Change
Code:
if(empty($_POST['warn_maturity']) OR $_POST['warn_maturity'] == '')
To
Code:
if(empty($_POST['warn_maturity']) OR trim($_POST['warn_maturity']) == '')
- Zero Tolerance
|
Well, I do not have ZT's programming experience, but if we want to be accurate, I think that these checks should be coded as below:
PHP Code:
if(empty($_POST['warn_name']) OR trim($_POST['warn_name']) == '')
{
print_stop_message('warning_warn_emptywarntype');
}
if(empty($_POST['warn_desc']) OR trim($_POST['warn_desc']) == '')
{
print_stop_message('warning_warn_emptydesc');
}
if(empty($_POST['warn_points']) OR $_POST['warn_points'] == '' OR $_POST['warn_points']<1 OR $_POST['warn_points']>99999)
{
print_stop_message('warning_warn_emptypoints');
}
if(empty($_POST['warn_maturity']) OR $_POST['warn_maturity']=='' OR $_POST['warn_maturity']<1 OR $_POST['warn_maturity']>99999)
{
print_stop_message('warning_warn_maturity');
}
The first two fields are character, so the trim function makes sense, the other two are numeric, so I guess we should also check to make sure it is numeric, otherwise the user may enter a maturity of abcde and the check will not catch it.
Rgds