From abbb6e5e70c3ec96a74f1299f02c5989efe8041a Mon Sep 17 00:00:00 2001 From: Bill McGonigle Date: Wed, 11 May 2022 20:58:53 +0000 Subject: [PATCH] support php_fpm under Apache 2.4 (missing PATH_INFO with Apache handler). --- inc/CalDAVRequest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 1f1aaba3..ab151aae 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -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 "/"!!!'); }