Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
07e21f60
Commit
07e21f60
authored
Feb 15, 2011
by
Eloy Lafuente
Browse files
Merge branch 'w07_MDL-26211_20_https' of
git://github.com/skodak/moodle
parents
d83bad41
2a9c0d05
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/setuplib.php
View file @
07e21f60
...
...
@@ -721,15 +721,14 @@ function setup_get_remote_url() {
list
(
$rurl
[
'host'
])
=
explode
(
':'
,
$_SERVER
[
'HTTP_HOST'
]);
$rurl
[
'port'
]
=
$_SERVER
[
'SERVER_PORT'
];
$rurl
[
'path'
]
=
$_SERVER
[
'SCRIPT_NAME'
];
// Script path without slash arguments
$rurl
[
'scheme'
]
=
(
empty
(
$_SERVER
[
'HTTPS'
])
or
$_SERVER
[
'HTTPS'
]
===
'off'
or
$_SERVER
[
'HTTPS'
]
===
'Off'
or
$_SERVER
[
'HTTPS'
]
===
'OFF'
)
?
'http'
:
'https'
;
if
(
stripos
(
$_SERVER
[
'SERVER_SOFTWARE'
],
'apache'
)
!==
false
)
{
//Apache server
$rurl
[
'scheme'
]
=
empty
(
$_SERVER
[
'HTTPS'
])
?
'http'
:
'https'
;
$rurl
[
'fullpath'
]
=
$_SERVER
[
'REQUEST_URI'
];
}
else
if
(
stripos
(
$_SERVER
[
'SERVER_SOFTWARE'
],
'iis'
)
!==
false
)
{
//IIS - needs a lot of tweaking to make it work
$rurl
[
'scheme'
]
=
(
$_SERVER
[
'HTTPS'
]
==
'off'
)
?
'http'
:
'https'
;
$rurl
[
'fullpath'
]
=
$_SERVER
[
'SCRIPT_NAME'
];
// NOTE: ignore PATH_INFO because it is incorrectly encoded using 8bit filesystem legacy encoding in IIS
...
...
@@ -745,7 +744,6 @@ function setup_get_remote_url() {
}
else
if
(
stripos
(
$_SERVER
[
'SERVER_SOFTWARE'
],
'lighttpd'
)
!==
false
)
{
//lighttpd - not officially supported
$rurl
[
'scheme'
]
=
empty
(
$_SERVER
[
'HTTPS'
])
?
'http'
:
'https'
;
$rurl
[
'fullpath'
]
=
$_SERVER
[
'REQUEST_URI'
];
// TODO: verify this is always properly encoded
}
else
if
(
stripos
(
$_SERVER
[
'SERVER_SOFTWARE'
],
'nginx'
)
!==
false
)
{
...
...
@@ -753,22 +751,18 @@ function setup_get_remote_url() {
if
(
!
isset
(
$_SERVER
[
'SCRIPT_NAME'
]))
{
die
(
'Invalid server configuration detected, please try to add "fastcgi_param SCRIPT_NAME $fastcgi_script_name;" to the nginx server configuration.'
);
}
$rurl
[
'scheme'
]
=
empty
(
$_SERVER
[
'HTTPS'
])
?
'http'
:
'https'
;
$rurl
[
'fullpath'
]
=
$_SERVER
[
'REQUEST_URI'
];
// TODO: verify this is always properly encoded
}
else
if
(
stripos
(
$_SERVER
[
'SERVER_SOFTWARE'
],
'cherokee'
)
!==
false
)
{
//cherokee - not officially supported
$rurl
[
'scheme'
]
=
(
$_SERVER
[
'HTTPS'
]
==
'off'
)
?
'http'
:
'https'
;
$rurl
[
'fullpath'
]
=
$_SERVER
[
'REQUEST_URI'
];
// TODO: verify this is always properly encoded
}
else
if
(
stripos
(
$_SERVER
[
'SERVER_SOFTWARE'
],
'zeus'
)
!==
false
)
{
//zeus - not officially supported
$rurl
[
'scheme'
]
=
(
$_SERVER
[
'HTTPS'
]
==
'off'
)
?
'http'
:
'https'
;
$rurl
[
'fullpath'
]
=
$_SERVER
[
'REQUEST_URI'
];
// TODO: verify this is always properly encoded
}
else
if
(
stripos
(
$_SERVER
[
'SERVER_SOFTWARE'
],
'LiteSpeed'
)
!==
false
)
{
//LiteSpeed - not officially supported
$rurl
[
'scheme'
]
=
(
$_SERVER
[
'HTTPS'
]
==
'off'
)
?
'http'
:
'https'
;
$rurl
[
'fullpath'
]
=
$_SERVER
[
'REQUEST_URI'
];
// TODO: verify this is always properly encoded
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment