issue #1: fixing validation of sever fields
parent
e880aab22a
commit
f7f7491f85
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue