support php_fpm under Apache 2.4 (missing PATH_INFO with Apache handler).

This commit is contained in:
Bill McGonigle 2022-05-11 20:58:53 +00:00 committed by Andrew Ruthven
parent 7d2bbeb37c
commit abbb6e5e70

View File

@ -179,6 +179,12 @@ class CalDAVRequest
if ( substr($this->path,0,1) != '/' )
$this->path = '/'.$this->path;
}
/* support php_fpm under Apache 2.4 */
else if ( isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME'] ) ) {
if ( preg_match( '{^(.*?\.php)([^?]*)}', $_SERVER['SCRIPT_NAME'] ) ) {
$this->path = $_SERVER['REQUEST_URI'];
}
}
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 "/"!!!');
}