issue #1: fixing validation of sever fields

This commit is contained in:
Pepijn Over 2014-03-20 01:24:50 +01:00
parent e880aab22a
commit f7f7491f85
1 changed files with 5 additions and 6 deletions

View File

@ -159,13 +159,12 @@ class ServerController extends AbstractServerController {
$clean = array( $clean = array(
'label' => strip_tags($_POST['label']), 'label' => strip_tags($_POST['label']),
'ip' => strip_tags($_POST['ip']), 'ip' => strip_tags($_POST['ip']),
'port' => strip_tags($_POST['port']), 'port' => intval($_POST['port']),
// @todo validate the following values 'type' => in_array($_POST['type'], array('website', 'service')) ? $_POST['type'] : 'website',
'type' => $_POST['type'],
'pattern' => $_POST['pattern'], 'pattern' => $_POST['pattern'],
'active' => $_POST['active'], 'active' => in_array($_POST['active'], array('yes', 'no')) ? $_POST['active'] : 'no',
'email' => $_POST['email'], 'email' => in_array($_POST['email'], array('yes', 'no')) ? $_POST['email'] : 'no',
'sms' => $_POST['sms'], 'sms' => in_array($_POST['sms'], array('yes', 'no')) ? $_POST['sms'] : 'no',
); );
// check for edit or add // check for edit or add