if request URI contains a full url, remove schema and domain

This commit is contained in:
Ralf Becker 2012-07-11 17:45:38 +00:00
parent 407dd173c3
commit 1a5a6ab7f9

View File

@ -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)) {