summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system.php
diff options
context:
space:
mode:
authorDavid P Hilton <david.hilton.p@gmail.com>2013-12-12 04:21:17 -0700
committerDavid P Hilton <david.hilton.p@gmail.com>2013-12-12 04:21:17 -0700
commit8adb814b30340114407ffc7a0df9e723f7d19d80 (patch)
tree9a63be77b9153febb353612201908487cf759bf8 /usr/local/www/system.php
parentaebf41dfa424604315e42bf0cc3ca545760989ea (diff)
downloadpfsense-8adb814b30340114407ffc7a0df9e723f7d19d80.zip
pfsense-8adb814b30340114407ffc7a0df9e723f7d19d80.tar.gz
/usr/local/www/system.php: strip excess whitespace from ntp field before processing
Diffstat (limited to 'usr/local/www/system.php')
-rwxr-xr-xusr/local/www/system.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index 2cbdccf..74159f6 100755
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -155,6 +155,9 @@ if ($_POST) {
if (($t < 0) || (($t > 0) && ($t < 6)) || ($t > 1440)) {
$input_errors[] = gettext("The time update interval must be either 0 (disabled) or between 6 and 1440.");
}
+ # it's easy to have a little too much whitespace in the field, clean it up for the user before processing.
+ $_POST['timeservers'] = preg_replace('/[[:blank:]]+/', ' ', $_POST['timeservers']);
+ $_POST['timeservers'] = trim($_POST['timeservers']);
foreach (explode(' ', $_POST['timeservers']) as $ts) {
if (!is_domain($ts)) {
$input_errors[] = gettext("A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.");
OpenPOWER on IntegriCloud