From 6743d6c520bb70be4198ffc7c5c72848d877b2e2 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 10 Apr 2011 13:59:17 +0200 Subject: [PATCH] MDL-26910 add HTTPD server name whitelisting --- lib/setuplib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/setuplib.php b/lib/setuplib.php index 1056db449a1..63e062cb02d 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -772,6 +772,10 @@ function setup_get_remote_url() { //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 { throw new moodle_exception('unsupportedwebserver', 'error', '', $_SERVER['SERVER_SOFTWARE']); }