summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN0YB <Al_Stu@Frontier.com>2014-06-13 11:11:48 -0700
committerN0YB <Al_Stu@Frontier.com>2014-06-13 11:11:48 -0700
commit061ac3f364c342a433c0adf44b6dd77e0ccec8a9 (patch)
tree7931944aa17c3c1f1489ee00b1f5d8cf46927266
parentf5b26faabcfabc01e83fe9bf76e9d697c6fe4afb (diff)
downloadpfsense-061ac3f364c342a433c0adf44b6dd77e0ccec8a9.zip
pfsense-061ac3f364c342a433c0adf44b6dd77e0ccec8a9.tar.gz
Better string check
-rw-r--r--usr/local/www/widgets/widgets/gateways.widget.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr/local/www/widgets/widgets/gateways.widget.php b/usr/local/www/widgets/widgets/gateways.widget.php
index 4f580ad..24b8afd 100644
--- a/usr/local/www/widgets/widgets/gateways.widget.php
+++ b/usr/local/www/widgets/widgets/gateways.widget.php
@@ -71,16 +71,17 @@ $counter = 1;
<td class="vncellt ellipsis" width="100%">
<div id="gateway<?php echo $counter; ?>" style="display:inline">
<?php
+ $if_gw = '';
if (is_ipaddr($gateway['gateway']))
- echo htmlspecialchars($gateway['gateway']);
+ $if_gw = htmlspecialchars($gateway['gateway']);
else {
if($gateway['ipprotocol'] == "inet")
- echo htmlspecialchars(get_interface_gateway($gateway['friendlyiface']));
+ $if_gw = htmlspecialchars(get_interface_gateway($gateway['friendlyiface']));
if($gateway['ipprotocol'] == "inet6")
- echo htmlspecialchars(get_interface_gateway_v6($gateway['friendlyiface']));
- if( (htmlspecialchars(get_interface_gateway($gateway['friendlyiface'])) == '') && (htmlspecialchars(get_interface_gateway_v6($gateway['friendlyiface'])) == '') )
- echo '~';
+ $if_gw = htmlspecialchars(get_interface_gateway_v6($gateway['friendlyiface']));
}
+ echo ($if_gw == '' ? '~' : $if_gw);
+ unset ($if_gw);
$counter++;
?>
</div>
OpenPOWER on IntegriCloud