Quote:
Originally Posted by Delphiprogrammi
that's due to a bug in the code that's checks if those propertys are filled in properly to resolve that open the file admin_warn.php and find
PHP Code:
if ($warn_opts['allowoffpost']=='No' AND $_POST['warn_type']=='No')
{
define('CP_REDIRECT', 'admin_warn.php?act=view');
print_stop_message('warning_warn_typeconflict');
}
after that add
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 trim($_POST['warn_points']) == '')
{
print_stop_message('warning_warn_emptypoints');
}
if(empty($_POST['warn_maturity']) OR trim($_POST['warn_maturity'])== '')
{
print_stop_message('warning_warn_maturity');
}
i am verry sorry for making such a stupid mistake that code is mine John is innocent
|
Delphi, the code you provide is not exactly correct, and since you want the checks, I guess we need to code them properly. The two first fields are character, so the trim function is necessary, the last two are numeric, so the check should be a little different, see 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');
}
If not, the user can enter a maturity of 'abcde' and the check will not stop him.
I've updated the zip file with this.
Rgds