summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-12-22 06:53:09 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2010-12-22 07:05:48 -0700
commit1930ccb627965e49ce8bc5c14fcae6b98795b09b (patch)
tree43a2d34166afd5bc33b453e9033c44203cda05eb /usr/local/www
parent0d86d650183febdd57c89d6fe1fe6c76eebee838 (diff)
downloadpfsense-1930ccb627965e49ce8bc5c14fcae6b98795b09b.zip
pfsense-1930ccb627965e49ce8bc5c14fcae6b98795b09b.tar.gz
Modify comparisons for antenna settings to be more restrictive. Might help with ticket #1121
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/interfaces.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 2d821ab..6963694 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -759,15 +759,15 @@ function handle_wireless_post() {
$config['wireless']['interfaces'][$wlanbaseif] = array();
} else if (isset($config['wireless']['interfaces'][$wlanbaseif]))
unset($config['wireless']['interfaces'][$wlanbaseif]);
- if (isset($_POST['diversity']) && $_POST['diversity'] != "")
+ if (isset($_POST['diversity']) && is_numeric($_POST['diversity']))
$wancfg['wireless']['diversity'] = $_POST['diversity'];
else if (isset($wancfg['wireless']['diversity']))
unset($wancfg['wireless']['diversity']);
- if (isset($_POST['txantenna']) && $_POST['txantenna'] != "")
+ if (isset($_POST['txantenna']) && is_numeric($_POST['txantenna']))
$wancfg['wireless']['txantenna'] = $_POST['txantenna'];
else if (isset($wancfg['wireless']['txantenna']))
unset($wancfg['wireless']['txantenna']);
- if (isset($_POST['rxantenna']) && $_POST['rxantenna'] != "")
+ if (isset($_POST['rxantenna']) && is_numeric($_POST['rxantenna']))
$wancfg['wireless']['rxantenna'] = $_POST['rxantenna'];
else if (isset($wancfg['wireless']['rxantenna']))
unset($wancfg['wireless']['rxantenna']);
@@ -1653,9 +1653,9 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp"
<td>
<?=gettext("Diversity"); ?><br/>
<select name="diversity" class="formselect" id="diversity">
- <option <?php if (empty($pconfig['diversity'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option>
- <option <?php if ($pconfig['diversity'] == '0') echo "selected"; ?> value="0"><?=gettext("Off"); ?></option>
- <option <?php if ($pconfig['diversity'] == '1') echo "selected"; ?> value="1"><?=gettext("On"); ?></option>
+ <option <?php if (!isset($pconfig['diversity'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option>
+ <option <?php if ($pconfig['diversity'] === '0') echo "selected"; ?> value="0"><?=gettext("Off"); ?></option>
+ <option <?php if ($pconfig['diversity'] === '1') echo "selected"; ?> value="1"><?=gettext("On"); ?></option>
</select>
</td>
<td>&nbsp;&nbsp</td>
@@ -1664,10 +1664,10 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp"
<td>
<?=gettext("Transmit antenna"); ?><br/>
<select name="txantenna" class="formselect" id="txantenna">
- <option <?php if (empty($pconfig['txantenna'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option>
- <option <?php if ($pconfig['txantenna'] == '0') echo "selected"; ?> value="0"><?=gettext("Auto"); ?></option>
- <option <?php if ($pconfig['txantenna'] == '1') echo "selected"; ?> value="1"><?=gettext("#1"); ?></option>
- <option <?php if ($pconfig['txantenna'] == '2') echo "selected"; ?> value="2"><?=gettext("#2"); ?></option>
+ <option <?php if (!isset($pconfig['txantenna'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option>
+ <option <?php if ($pconfig['txantenna'] === '0') echo "selected"; ?> value="0"><?=gettext("Auto"); ?></option>
+ <option <?php if ($pconfig['txantenna'] === '1') echo "selected"; ?> value="1"><?=gettext("#1"); ?></option>
+ <option <?php if ($pconfig['txantenna'] === '2') echo "selected"; ?> value="2"><?=gettext("#2"); ?></option>
</select>
</td>
<td>&nbsp;&nbsp</td>
@@ -1676,10 +1676,10 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp"
<td>
<?=gettext("Receive antenna"); ?><br/>
<select name="rxantenna" class="formselect" id="rxantenna">
- <option <?php if (empty($pconfig['rxantenna'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option>
- <option <?php if ($pconfig['rxantenna'] == '0') echo "selected"; ?> value="0"><?=gettext("Auto"); ?></option>
- <option <?php if ($pconfig['rxantenna'] == '1') echo "selected"; ?> value="1"><?=gettext("#1"); ?></option>
- <option <?php if ($pconfig['rxantenna'] == '2') echo "selected"; ?> value="2"><?=gettext("#2"); ?></option>
+ <option <?php if (!isset($pconfig['rxantenna'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option>
+ <option <?php if ($pconfig['rxantenna'] === '0') echo "selected"; ?> value="0"><?=gettext("Auto"); ?></option>
+ <option <?php if ($pconfig['rxantenna'] === '1') echo "selected"; ?> value="1"><?=gettext("#1"); ?></option>
+ <option <?php if ($pconfig['rxantenna'] === '2') echo "selected"; ?> value="2"><?=gettext("#2"); ?></option>
</select>
</td>
<?php endif; ?>
OpenPOWER on IntegriCloud