mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-04-29 15:51:27 +00:00
Fix errors in calculated PATH_INFO.
This commit is contained in:
parent
f75d51284b
commit
d6ddf8e426
@ -147,13 +147,14 @@ class CalDAVRequest
|
||||
$this->path = $_SERVER['PATH_INFO'];
|
||||
}
|
||||
else {
|
||||
$this->path = "/";
|
||||
$this->path = '/';
|
||||
if ( isset($_SERVER['REQUEST_URI']) ) {
|
||||
$path = preg_replace( '{^(.*?\.php/?)}', '/', $_SERVER['REQUEST_URI'], $matches );
|
||||
if ( !empty($matches[1]) ) {
|
||||
$this->path = $path;
|
||||
if ( preg_match( '{^(.*?\.php)(.*)$}', $_SERVER['REQUEST_URI'], $matches ) ) {
|
||||
$this->path = $matches[2];
|
||||
if ( substr($this->path,0,1) != '/' )
|
||||
$this->path = '/'.$this->path;
|
||||
}
|
||||
else {
|
||||
else if ( $_SERVER['REQUEST_URI'] != '/' ) {
|
||||
dbg_error_log('LOG', 'Server is not supplying PATH_INFO and REQUEST_URI does not include a PHP program. Wildly guessing "/"!!!');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user