1
0
mirror of https://github.com/Rouji/single_php_filehost.git synced 2025-04-03 16:09:33 +00:00

Do not assume script is installed in root dir (#20)

This commit is contained in:
Sandro Santilli 2022-08-23 06:05:14 +02:00 committed by GitHub
parent 1326c8cbc3
commit 6c5d984efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ class CONFIG
public static function SITE_URL() : string
{
$proto = ($_SERVER['HTTPS'] ?? 'off') == 'on' ? 'https' : 'http';
return "$proto://{$_SERVER['HTTP_HOST']}/";
return "$proto://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
}
};