diff options
author | k-paulius <k.dash.paulius@gmail.com> | 2015-02-25 20:44:50 -0600 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-02-26 09:31:47 -0300 |
commit | e607009a49297ec55fab4b6aee7fc03947287269 (patch) | |
tree | 5755921a0972e83f50fda1a9e49a40d19e532bd0 /usr/local/www/services_ntpd.php | |
parent | 2798bb681fabea10355177eab12132daaec90e88 (diff) | |
download | pfsense-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.
Diffstat (limited to 'usr/local/www/services_ntpd.php')
-rw-r--r-- | usr/local/www/services_ntpd.php | 4 |
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\" /> "; 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 " /> prefer "; 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 " /> noselect\n<br />\n</div>\n"; } ?> |