diff options
author | jim-p <jimp@pfsense.org> | 2012-05-30 12:59:23 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-05-30 12:59:23 -0400 |
commit | 58168f4e2a74cb08d62bfb9715a6627b108a7ac8 (patch) | |
tree | af97352143c47fa9f7909feaf97845c1f813641f /usr/local/www | |
parent | cf180ccc2a6f91e37b3738bb4a1b14bebbf9ef63 (diff) | |
download | pfsense-58168f4e2a74cb08d62bfb9715a6627b108a7ac8.zip pfsense-58168f4e2a74cb08d62bfb9715a6627b108a7ac8.tar.gz |
Fix input validation and import test.
Diffstat (limited to 'usr/local/www')
-rw-r--r-- | usr/local/www/services_ntpd.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/usr/local/www/services_ntpd.php b/usr/local/www/services_ntpd.php index 86d4fb4..9948a1d 100644 --- a/usr/local/www/services_ntpd.php +++ b/usr/local/www/services_ntpd.php @@ -40,8 +40,8 @@ require("guiconfig.inc"); if (empty($config['ntpd']['interface'])) - if (empty($config['openntpd']['config']['interface'])) { - $pconfig['interface'] = explode(",", $config['installedpackages']['openntpd']['config'][0]['interface']); + if (!empty($config['installedpackages']['openntpd']['config'][0]['interface'])) + $interfaces = explode(",", $config['installedpackages']['openntpd']['config'][0]['interface']); unset($config['installedpackages']['openntpd']); } else $pconfig['interface'] = array(); @@ -53,14 +53,11 @@ if ($_POST) { unset($input_errors); $pconfig = $_POST; - /* input validation */ - $reqdfields = explode(" ", "interface"); - $reqdfieldsn = array(gettext("Interface")); - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if (!$input_errors) { - $config['ntpd']['interface'] = implode(",", $_POST['interface']); + if (is_array($_POST['interface'])) + $config['ntpd']['interface'] = implode(",", $_POST['interface']); + elseif (isset($config['ntpd']['interface'])) + unset($config['ntpd']['interface']); write_config("Updated NTP Server Settings"); |