From 1a5a6ab7f95987f2feb366c723d4558007b37ec8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 11 Jul 2012 17:45:38 +0000 Subject: [PATCH] if request URI contains a full url, remove schema and domain --- egw-pear/HTTP/WebDAV/Server.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/egw-pear/HTTP/WebDAV/Server.php b/egw-pear/HTTP/WebDAV/Server.php index b007d89207..f735a505d1 100644 --- a/egw-pear/HTTP/WebDAV/Server.php +++ b/egw-pear/HTTP/WebDAV/Server.php @@ -188,7 +188,12 @@ class HTTP_WebDAV_Server // WebDAV has no concept of a query string and clients (including cadaver) // seem to pass '?' unencoded, so we need to extract the path info out // of the request URI ourselves - $path_info = substr($this->_SERVER["REQUEST_URI"], strlen($this->_SERVER["SCRIPT_NAME"])); + // if request URI contains a full url, remove schema and domain + if (preg_match('|^https?://[^/]+(/.*)$|', $path_info=$this->_SERVER["REQUEST_URI"], $matches)) + { + $path_info = $matches[1]; + } + $path_info = substr($path_info, strlen($this->_SERVER["SCRIPT_NAME"])); // just in case the path came in empty ... if (empty($path_info)) {