summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_captiveportal.php
diff options
context:
space:
mode:
authorMichael Newton <miken32@gmail.com>2013-02-12 11:11:56 -0800
committerMichael Newton <miken32@gmail.com>2013-02-12 11:17:22 -0800
commit89b1c40c41ea16d0beac1ffbde9334f657e66e5c (patch)
tree4a2d680e87e22c27fa96fb1f4cc971cc88f6e271 /usr/local/www/services_captiveportal.php
parentf9dc100c3c52323c326ae09591857d78cc5bd5c0 (diff)
downloadpfsense-89b1c40c41ea16d0beac1ffbde9334f657e66e5c.zip
pfsense-89b1c40c41ea16d0beac1ffbde9334f657e66e5c.tar.gz
add input validation for NAS-Identifier
Diffstat (limited to 'usr/local/www/services_captiveportal.php')
-rwxr-xr-xusr/local/www/services_captiveportal.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index 35616a2..b465baa 100755
--- a/usr/local/www/services_captiveportal.php
+++ b/usr/local/www/services_captiveportal.php
@@ -224,6 +224,9 @@ if ($_POST) {
if ($_POST['maxproc'] && (!is_numeric($_POST['maxproc']) || ($_POST['maxproc'] < 4) || ($_POST['maxproc'] > 100))) {
$input_errors[] = gettext("The maximum number of concurrent connections per client IP address may not be larger than the global maximum.");
}
+ if (trim($_POST['radiusnasid']) !== "" && !preg_match("/^[\x21-\x7e]{3,253}$/i", trim($_POST['radiusnasid']))) {
+ $input_errors[] = gettext("The NAS-Identifier must be 3-253 characters long and should only contain ASCII characters.");
+ }
if (!$input_errors) {
$newcp =& $a_cp[$cpzone];
@@ -827,8 +830,8 @@ function enable_change(enable_change) {
<tr>
<td class="vncell" valign="top"><?=gettext("NAS Identifier"); ?></td>
- <td class="vtable"><input name="radiusnasid" type="text" class="formfld unknown" id="radiusnasid" value="<?=htmlspecialchars($pconfig['radiusnasid']);?>"/><br/>
- <?=gettext("Specify a NAS identifier to override the default value") . " " . php_uname("n"); ?></td>
+ <td class="vtable"><input name="radiusnasid" type="text" maxlength="253" class="formfld unknown" id="radiusnasid" value="<?=htmlspecialchars($pconfig['radiusnasid']);?>"/><br/>
+ <?=gettext("Specify a NAS identifier to override the default value") . " (" . php_uname("n") . ")"; ?></td>
</tr>
<tr>
<td class="vncell" valign="top"><?=gettext("MAC address format"); ?></td>
OpenPOWER on IntegriCloud