From 822e81644d1b0417faab17a7864b8a38db0b4966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=81n=20Ma=CC=81te=CC=81?= Date: Wed, 14 May 2014 13:33:36 +0200 Subject: [PATCH] expand-property repord - prevent infinite recursion and recursion to the object itself (non-recursive getting request URL properties) --- inc/caldav-REPORT-expand-property.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/caldav-REPORT-expand-property.php b/inc/caldav-REPORT-expand-property.php index c119c6f3..ba5a8f9f 100644 --- a/inc/caldav-REPORT-expand-property.php +++ b/inc/caldav-REPORT-expand-property.php @@ -71,7 +71,9 @@ function expand_properties( $urls, $ptree, &$reply, $recurse_again = true ) { $paths = array(); foreach( $hrefs AS $k => $v ) { $content = $v->GetContent(); - $paths[] = $content; + // prevent infinite recursion and recursion to the object itself (non-recursive getting request URL properties) + if($content[0]=='/' && $content!='/caldav.php'.str_replace( '%2F', '/', rawurlencode($url))) + $paths[] = $content; } // dbg_error_log('REPORT',' Found property "%s" contains hrefs "%s"', $pname, implode(', ',$paths) ); $property->SetContent( expand_properties($paths, $subtrees[$pname], $reply, false) );