mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-83391 core: Remove hard-coded "support" for webservers.
This allows for more flexibility with web server software.
This commit is contained in:
parent
67f5ee3cec
commit
aa8c304af2
1 changed files with 2 additions and 29 deletions
|
@ -845,41 +845,14 @@ function setup_get_remote_url() {
|
||||||
}
|
}
|
||||||
$_SERVER['REQUEST_URI'] = $rurl['fullpath']; // extra IIS compatibility
|
$_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) {
|
} else if (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) {
|
||||||
//nginx - not officially supported
|
|
||||||
if (!isset($_SERVER['SCRIPT_NAME'])) {
|
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.');
|
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'];
|
$rurl['fullpath'] = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
} else {
|
} 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
|
// sanitize the url a bit more, the encoding style may be different in vars above
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue