Skip to content

Commit

Permalink
Move the gethostname() call to a variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed May 29, 2020
1 parent f1eb744 commit f934e9a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/pi-hole/php/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
require "scripts/pi-hole/php/password.php";
require_once "scripts/pi-hole/php/FTL.php";
require "scripts/pi-hole/php/theme.php";

$scriptname = basename($_SERVER['SCRIPT_FILENAME']);
$hostname = gethostname() ? gethostname() : "";

check_cors();

Expand Down Expand Up @@ -183,7 +185,7 @@ function pidofFTL()
<meta http-equiv="cache-control" content="max-age=60,private">
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pi-hole<?php echo gethostname() ? " - " . gethostname() : "" ?></title>
<title>Pi-hole<?php echo $hostname ? " - " . $hostname : "" ?></title>

<link rel="apple-touch-icon" href="img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
Expand Down Expand Up @@ -276,10 +278,10 @@ function pidofFTL()
<span class="label label-warning" id="pihole-diagnosis-count"></span>
</a>
</li>
<li<?php echo !gethostname() ? ' class="hidden"' : "" ?>>
<li<?php echo !$hostname ? ' class="hidden"' : "" ?>>
<p class="navbar-text">
<span class="hidden-xs hidden-sm">hostname:</span>
<code><?php echo gethostname() ? gethostname() : "" ?></code>
<code><?php echo $hostname; ?></code>
</p>
</li>
<li class="dropdown user user-menu">
Expand Down

0 comments on commit f934e9a

Please sign in to comment.