summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_ntpd.php
diff options
context:
space:
mode:
authork-paulius <k.dash.paulius@gmail.com>2015-02-25 20:44:50 -0600
committerk-paulius <k.dash.paulius@gmail.com>2015-02-25 20:44:50 -0600
commit1022105058c4550508dc801bb6cd233625a17226 (patch)
treedb00f46826b87825ee4d89e3cb7956032da9675a /usr/local/www/services_ntpd.php
parent3d16300449b68833a4f37e8675871c0098fe4c5e (diff)
downloadpfsense-1022105058c4550508dc801bb6cd233625a17226.zip
pfsense-1022105058c4550508dc801bb6cd233625a17226.tar.gz
Check if variables are set before trying to pass them to function substr_count to avoid generating PHP alerts.
Diffstat (limited to 'usr/local/www/services_ntpd.php')
-rw-r--r--usr/local/www/services_ntpd.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/local/www/services_ntpd.php b/usr/local/www/services_ntpd.php
index 05cc0a1..8c2dcaa 100644
--- a/usr/local/www/services_ntpd.php
+++ b/usr/local/www/services_ntpd.php
@@ -297,10 +297,10 @@ include("head.inc");
echo "<input name=\"server{$i}\" class=\"formfld unknown\" id=\"server{$i}\" size=\"30\" value=\"{$timeservers[$i]}\" type=\"text\" />&emsp;";
echo "\n<input name=\"servprefer{$i}\" class=\"formcheckbox\" id=\"servprefer{$i}\" onclick=\"CheckOffOther('servprefer{$i}', 'servselect{$i}')\" type=\"checkbox\"";
- if (substr_count($config['ntpd']['prefer'], $timeservers[$i])) echo " checked=\"checked\"";
+ if (isset($config['ntpd']['prefer']) && isset($timeservers[$i]) && substr_count($config['ntpd']['prefer'], $timeservers[$i])) echo " checked=\"checked\"";
echo " />&nbsp;prefer&emsp;";
echo "\n<input name=\"servselect{$i}\" class=\"formcheckbox\" id=\"servselect{$i}\" onclick=\"CheckOffOther('servselect{$i}', 'servprefer{$i}')\" type=\"checkbox\"";
- if (substr_count($config['ntpd']['noselect'], $timeservers[$i])) echo " checked=\"checked\"";
+ if (isset($config['ntpd']['noselect']) && isset($timeservers[$i]) && substr_count($config['ntpd']['noselect'], $timeservers[$i])) echo " checked=\"checked\"";
echo " />&nbsp;noselect\n<br />\n</div>\n";
}
?>
OpenPOWER on IntegriCloud