summaryrefslogtreecommitdiffstats
path: root/usr/local/www/load_balancer_pool_edit.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2015-03-31 09:26:04 -0400
committerjim-p <jimp@pfsense.org>2015-03-31 09:26:04 -0400
commit05a463843a9dbb4901974f22fb361873adcaae4b (patch)
treed757d264f41abc43cdd2e7b9bbbf28d3c835f1f0 /usr/local/www/load_balancer_pool_edit.php
parent807cdae39e9e5d836f40d9b1a828bd3d71a9013c (diff)
downloadpfsense-05a463843a9dbb4901974f22fb361873adcaae4b.zip
pfsense-05a463843a9dbb4901974f22fb361873adcaae4b.tar.gz
Fix a few misc encoding issues in load balancer code.
Diffstat (limited to 'usr/local/www/load_balancer_pool_edit.php')
-rw-r--r--usr/local/www/load_balancer_pool_edit.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php
index f3b0dca..4eaa6f0 100644
--- a/usr/local/www/load_balancer_pool_edit.php
+++ b/usr/local/www/load_balancer_pool_edit.php
@@ -87,8 +87,11 @@ if ($_POST) {
if (($_POST['name'] == $config['load_balancer']['lbpool'][$i]['name']) && ($i != $id))
$input_errors[] = gettext("This pool name has already been used. Pool names must be unique.");
- if (strpos($_POST['name'], " ") !== false)
- $input_errors[] = gettext("You cannot use spaces in the 'name' field.");
+ if (preg_match('/[ \/]/', $_POST['name']))
+ $input_errors[] = gettext("You cannot use spaces or slashes in the 'name' field.");
+
+ if (strlen($_POST['name']) > 16)
+ $input_errors[] = gettext("The 'name' field must be 16 characters or less.");
if (in_array($_POST['name'], $reserved_table_names))
$input_errors[] = sprintf(gettext("The name '%s' is a reserved word and cannot be used."), $_POST['name']);
@@ -200,7 +203,7 @@ function clearcombo(){
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Name"); ?></td>
<td width="78%" class="vtable" colspan="2">
- <input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="16" maxlength="16" />
+ <input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"" . htmlspecialchars($pconfig['name']) . "\"";?> size="16" maxlength="16" />
</td>
</tr>
<tr align="left">
@@ -215,7 +218,7 @@ function clearcombo(){
<tr align="left">
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable" colspan="2">
- <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?> size="64" />
+ <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"" . htmlspecialchars($pconfig['descr']) . "\"";?> size="64" />
</td>
</tr>
OpenPOWER on IntegriCloud