mirror of
https://github.com/moodle/moodle.git
synced 2025-03-20 15:40:17 +01:00
Merge branch 'MDL-83391-main' of https://github.com/cwarwicker/moodle
This commit is contained in:
commit
3d24572e55
@ -845,41 +845,14 @@ function setup_get_remote_url() {
|
||||
}
|
||||
$_SERVER['REQUEST_URI'] = $rurl['fullpath']; // extra IIS compatibility
|
||||
|
||||
/* NOTE: following servers are not fully tested! */
|
||||
|
||||
} else if (stripos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false) {
|
||||
//lighttpd - not officially supported
|
||||
$rurl['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded
|
||||
|
||||
} else if (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) {
|
||||
//nginx - not officially supported
|
||||
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['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded
|
||||
|
||||
} else if (stripos($_SERVER['SERVER_SOFTWARE'], 'cherokee') !== false) {
|
||||
//cherokee - not officially supported
|
||||
$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['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded
|
||||
|
||||
} else if (stripos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false) {
|
||||
//LiteSpeed - not officially supported
|
||||
$rurl['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded
|
||||
|
||||
} else if ($_SERVER['SERVER_SOFTWARE'] === 'HTTPD') {
|
||||
//obscure name found on some servers - this is definitely not supported
|
||||
$rurl['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded
|
||||
|
||||
} else if (strpos($_SERVER['SERVER_SOFTWARE'], 'PHP') === 0) {
|
||||
// built-in PHP Development Server
|
||||
$rurl['fullpath'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
} else {
|
||||
throw new moodle_exception('unsupportedwebserver', 'error', '', $_SERVER['SERVER_SOFTWARE']);
|
||||
// Any other servers we can assume will pass the request_uri normally.
|
||||
$rurl['fullpath'] = $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
|
||||
// sanitize the url a bit more, the encoding style may be different in vars above
|
||||
|
Loading…
x
Reference in New Issue
Block a user