mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-10-31 06:02:00 +01:00
issue #982 detect HTTPS based on forwarded protocol
This commit is contained in:
1 parent
a2da870d3a
commit
2e037205ff
1 file changed
+7
@@ -33,6 +33,13 @@ function get_root_url()
|
|||||||
function get_absolute_root_url($with_scheme=true)
|
function get_absolute_root_url($with_scheme=true)
|
||||||
{
|
{
|
||||||
// TODO - add HERE the possibility to call PWG functions from external scripts
|
// TODO - add HERE the possibility to call PWG functions from external scripts
|
||||||
|
|
||||||
|
// Support X-Forwarded-Proto header for HTTPS detection in PHP
|
||||||
|
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'])
|
||||||
|
{
|
||||||
|
$_SERVER['HTTPS'] = 'on';
|
||||||
|
}
|
||||||
|
|
||||||
$url = '';
|
$url = '';
|
||||||
if ($with_scheme)
|
if ($with_scheme)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user