summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/diag_ping.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-12-14 20:20:16 +0545
committerPhil Davis <phil.davis@inf.org>2015-12-14 20:20:16 +0545
commit947141fd21b4496d8963d1598d6ca6a2e000702c (patch)
treec4f39f94d05059417f3e5743fc7c826ea52657fc /src/usr/local/www/diag_ping.php
parent9ba351c17e4c85e01832e38b6ba7b6a7898a290d (diff)
downloadpfsense-947141fd21b4496d8963d1598d6ca6a2e000702c.zip
pfsense-947141fd21b4496d8963d1598d6ca6a2e000702c.tar.gz
Code style usr local www a-e
Diffstat (limited to 'src/usr/local/www/diag_ping.php')
-rw-r--r--src/usr/local/www/diag_ping.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/usr/local/www/diag_ping.php b/src/usr/local/www/diag_ping.php
index 140513e..cc5c442 100644
--- a/src/usr/local/www/diag_ping.php
+++ b/src/usr/local/www/diag_ping.php
@@ -117,7 +117,7 @@ if ($_POST || $_REQUEST['host']) {
if ($_POST) {
$do_ping = true;
}
- if(isset($_REQUEST['sourceip'])) {
+ if (isset($_REQUEST['sourceip'])) {
$sourceip = $_REQUEST['sourceip'];
}
$count = $_REQUEST['count'];
@@ -131,7 +131,7 @@ if ($do_ping) {
?>
<script type="text/javascript">
//<![CDATA[
- window.onload=function(){
+ window.onload=function() {
document.getElementById("pingCaptured").wrap='off';
}
//]]>
@@ -142,31 +142,35 @@ if ($do_ping) {
if ($ipproto == "ipv6") {
$command .= "6";
$ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
- if (is_linklocal($ifaddr))
+ if (is_linklocal($ifaddr)) {
$ifscope = get_ll_scope($ifaddr);
+ }
} else {
$ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
}
if ($ifaddr && (is_ipaddr($host) || is_hostname($host))) {
$srcip = "-S" . escapeshellarg($ifaddr);
- if (is_linklocal($host) && !strstr($host, "%") && !empty($ifscope))
+ if (is_linklocal($host) && !strstr($host, "%") && !empty($ifscope)) {
$host .= "%{$ifscope}";
+ }
}
$cmd = "{$command} {$srcip} -c" . escapeshellarg($count) . " " . escapeshellarg($host);
//echo "Ping command: {$cmd}\n";
$result = shell_exec($cmd);
- if (empty($result))
+ if (empty($result)) {
$input_errors[] = "Host \"" . $host . "\" did not respond or could not be resolved.";
+ }
}
include('head.inc');
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
+}
$form = new Form('Ping');
OpenPOWER on IntegriCloud