Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard gethostname() calls #1400

Merged
merged 2 commits into from
May 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 if (gethostname()) {echo " - ", 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>
<li<?php echo !$hostname ? ' class="hidden"' : "" ?>>
<p class="navbar-text">
<span class="hidden-xs hidden-sm">hostname:</span>
<code><?php echo gethostname(); ?></code>
<code><?php echo $hostname; ?></code>
</p>
</li>
<li class="dropdown user user-menu">
Expand Down