From 989cc98b521f28968e301616732fc1174411cacb Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 24 Aug 2009 12:09:17 +1200 Subject: [PATCH] Ensure incoming URLs are decoded before we process them. --- inc/CalDAVRequest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index a2340a14..549c32e1 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -186,7 +186,12 @@ class CalDAVRequest * the minimum privileges returned from that analysis. */ $this->path = (isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : ""); - if ( $this->path == null || $this->path == '' ) $this->path = '/'; + if ( $this->path == null || $this->path == '' ) { + $this->path = '/'; + } + else { + $this->path = rawurldecode($this->path); + } // dbg_error_log( "caldav", "Sanitising path '%s'", $this->path ); $bad_chars_regex = '/[\\^\\[\\(\\\\]/'; if ( preg_match( $bad_chars_regex, $this->path ) ) {