Better check for $_SERVER['PATH_INFO']

This commit is contained in:
eppesuig 2023-06-21 23:21:57 +00:00 committed by Andrew Ruthven
parent 6ac6b30c7a
commit de29c6c6ee
3 changed files with 3 additions and 3 deletions

View File

@ -279,7 +279,7 @@ if ( isset($_SERVER['HTTP_X_DAVICAL_TESTCASE']) ) {
else if ( isset($c->dbg['script_start']) && $c->dbg['script_start'] ) {
// Only log this if more than a little debugging of some sort is turned on, somewhere
@dbg_error_log( 'LOG', '==========> method =%s= =%s= =%s= =%s= =%s=',
$_SERVER['REQUEST_METHOD'], $c->protocol_server_port_script, (isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '$_SERVER[PATH_INFO] undefined'), $c->base_url, $c->base_directory );
$_SERVER['REQUEST_METHOD'], $c->protocol_server_port_script, (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] !== '' ? $_SERVER['PATH_INFO'] : '$_SERVER[PATH_INFO] undefined'), $c->base_url, $c->base_directory );
}
/**

View File

@ -168,7 +168,7 @@ class CalDAVRequest
* 4. otherwise we query the defined relationships between users and use
* the minimum privileges returned from that analysis.
*/
if ( isset($_SERVER['PATH_INFO']) ) {
if ( isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] !== '') {
$this->path = $_SERVER['PATH_INFO'];
}
else {

View File

@ -279,7 +279,7 @@ if ( isset($_SERVER['HTTP_X_DAVICAL_TESTCASE']) ) {
else if ( isset($c->dbg['script_start']) && $c->dbg['script_start'] ) {
// Only log this if more than a little debugging of some sort is turned on, somewhere
@dbg_error_log( 'LOG', '==========> method =%s= =%s= =%s= =%s= =%s=',
$_SERVER['REQUEST_METHOD'], $c->protocol_server_port_script, (isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '$_SERVER[PATH_INFO] undefined'), $c->base_url, $c->base_directory );
$_SERVER['REQUEST_METHOD'], $c->protocol_server_port_script, (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] !== '' ? $_SERVER['PATH_INFO'] : '$_SERVER[PATH_INFO] undefined'), $c->base_url, $c->base_directory );
}
/**