mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Fix error trying to access undefined variables on splash page.
Signed-off-by: Jaime Baez <j.baezcastillo@gmail.com>
This commit is contained in:
parent
b51751e892
commit
6198165df8
@ -58,20 +58,20 @@ if ($serverName === "pi.hole"
|
|||||||
// When directly browsing via IP or authorized hostname
|
// When directly browsing via IP or authorized hostname
|
||||||
// Render splash/landing page based off presence of $landPage file
|
// Render splash/landing page based off presence of $landPage file
|
||||||
// Unset variables so as to not be included in $landPage or $splashPage
|
// Unset variables so as to not be included in $landPage or $splashPage
|
||||||
unset($serverName, $svPasswd, $svEmail, $authorizedHosts, $validExtTypes, $currentUrlExt, $viewPort);
|
unset($svPasswd, $svEmail, $authorizedHosts, $validExtTypes, $currentUrlExt);
|
||||||
// If $landPage file is present
|
// If $landPage file is present
|
||||||
if (is_file(getcwd()."/$landPage")) {
|
if (is_file(getcwd()."/$landPage")) {
|
||||||
|
unset($serverName, $viewPort); // unset extra variables not to be included in $landpage
|
||||||
include $landPage;
|
include $landPage;
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
// If $landPage file was not present, Set Splash Page output
|
// If $landPage file was not present, Set Splash Page output
|
||||||
$splashPage = "
|
$splashPage = <<<EOT
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang='en'>
|
<html lang='en'>
|
||||||
<head>
|
<head>
|
||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
$viewPort
|
$viewPort
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>● $serverName</title>
|
<title>● $serverName</title>
|
||||||
<link rel='stylesheet' href='pihole/blockingpage.css'>
|
<link rel='stylesheet' href='pihole/blockingpage.css'>
|
||||||
<link rel='shortcut icon' href='admin/img/favicons/favicon.ico' type='image/x-icon'>
|
<link rel='shortcut icon' href='admin/img/favicons/favicon.ico' type='image/x-icon'>
|
||||||
@ -84,7 +84,7 @@ if ($serverName === "pi.hole"
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
";
|
EOT;
|
||||||
exit($splashPage);
|
exit($splashPage);
|
||||||
} elseif ($currentUrlExt === "js") {
|
} elseif ($currentUrlExt === "js") {
|
||||||
// Serve Pi-hole JavaScript for blocked domains requesting JS
|
// Serve Pi-hole JavaScript for blocked domains requesting JS
|
||||||
|
Loading…
Reference in New Issue
Block a user