From 3e1451a5d09fd470de1059b9d30a75495caf5f45 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 1 Nov 2010 14:53:57 +1300 Subject: [PATCH] Switch from regular expression which may not work in old/odd PHP. --- inc/caldav-REPORT-multiget.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inc/caldav-REPORT-multiget.php b/inc/caldav-REPORT-multiget.php index efaf31e0..c839c2e7 100644 --- a/inc/caldav-REPORT-multiget.php +++ b/inc/caldav-REPORT-multiget.php @@ -68,8 +68,15 @@ foreach( $mg_hrefs AS $k => $v ) { * anything up to the matching request->path (which will include any http...) and then * put the $bound_from prefix back on. */ - $href = $bound_from . preg_replace( "{^.*\E$request->path\Q}", '', rawurldecode($v->GetContent()) ); - dbg_error_log("REPORT", "Reporting on href '%s'", $href ); + $rawurl = rawurldecode($v->GetContent()); + $path_pos = strpos($rawurl,$request->path); + if ( $path_pos === false ) { + $href = $bound_from . $rawurl; + } + else { + $href = $bound_from . substr( $rawurl, $path_pos + strlen($request->path)); + } + @dbg_error_log("REPORT", 'Reporting on href "%s"', $href ); $href_in .= ($href_in == '' ? '' : ', '); $href_in .= ':href'.$k; $params[':href'.$k] = $href;