mirror of
https://github.com/Rouji/single_php_filehost.git
synced 2025-04-10 19:08:45 +00:00
Explicitly check for $_SERVER['HTTP_HOST']
This commit is contained in:
parent
76dff59ab7
commit
9d81fd1f20
15
index.php
15
index.php
@ -19,13 +19,16 @@ $ADMIN_EMAIL="admin@example.com"; //address for inquiries
|
|||||||
|
|
||||||
function site_url()
|
function site_url()
|
||||||
{
|
{
|
||||||
$url = 'http';
|
if (isset($_SERVER['HTTP_HOST']))
|
||||||
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|
|
||||||
{
|
{
|
||||||
$url .= 's';
|
$url = 'http';
|
||||||
}
|
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|
||||||
$url .= '://' . $_SERVER['HTTP_HOST'] . '/';
|
{
|
||||||
return $url;
|
$url .= 's';
|
||||||
|
}
|
||||||
|
$url .= '://' . $_SERVER['HTTP_HOST'] . '/';
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate a random string of characters with given length
|
// generate a random string of characters with given length
|
||||||
|
Loading…
Reference in New Issue
Block a user