summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork-paulius <k.dash.paulius@gmail.com>2015-02-25 20:44:50 -0600
committerRenato Botelho <garga@FreeBSD.org>2015-02-26 09:31:47 -0300
commite607009a49297ec55fab4b6aee7fc03947287269 (patch)
tree5755921a0972e83f50fda1a9e49a40d19e532bd0
parent2798bb681fabea10355177eab12132daaec90e88 (diff)
downloadpfsense-e607009a49297ec55fab4b6aee7fc03947287269.zip
pfsense-e607009a49297ec55fab4b6aee7fc03947287269.tar.gz
Check if variables are set before trying to pass them to function substr_count to avoid generating PHP alerts.
-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