diff --git a/inc/caldav-client-v2.php b/inc/caldav-client-v2.php index b305f307..8dcf258a 100644 --- a/inc/caldav-client-v2.php +++ b/inc/caldav-client-v2.php @@ -12,29 +12,29 @@ require_once('XMLDocument.php'); -/** - * A class for holding basic calendar information - * @package awl - */ -class CalendarInfo { +/** + * A class for holding basic calendar information + * @package awl + */ +class CalendarInfo { public $url; public $displayname; - public $getctag; - - function __construct( $url, $displayname = null, $getctag = null ) { - $this->url = $url; - $this->displayname = $displayname; - $this->getctag = $getctag; - } - - function __toString() { - return( '(URL: '.$this->url.' Ctag: '.$this->getctag.' Displayname: '.$this->displayname .')'. "\n" ); - } -} + public $getctag; -if(!defined("_FSOCK_TIMEOUT")){ - define("_FSOCK_TIMEOUT", 10); -} + function __construct( $url, $displayname = null, $getctag = null ) { + $this->url = $url; + $this->displayname = $displayname; + $this->getctag = $getctag; + } + + function __toString() { + return( '(URL: '.$this->url.' Ctag: '.$this->getctag.' Displayname: '.$this->displayname .')'. "\n" ); + } +} + +if(!defined("_FSOCK_TIMEOUT")){ + define("_FSOCK_TIMEOUT", 10); +} /** * A class for accessing DAViCal via CalDAV, as a client @@ -224,7 +224,7 @@ class CalDAVClient { $this->httpParsedHeaders = array(); $headers = str_replace("\r\n", "\n", $this->httpResponseHeaders); $ar_headers = explode("\n", $headers); - $last_header = ''; + $last_header = ''; foreach ($ar_headers as $cur_headers) { if( preg_match( '{^\s*\S}', $cur_headers) ) $header_name = $last_header; else if ( preg_match( '{^(\S*):', $cur_headers, $matches) ) { @@ -232,10 +232,10 @@ class CalDAVClient { $last_header = $header_name; if ( empty($this->httpParsedHeaders[$header_name]) ) $this->httpParsedHeaders[$header_name] = array(); } - $this->httpParsedHeaders[$header_name][] = $cur_headers; + $this->httpParsedHeaders[$header_name][] = $cur_headers; } } - return $this->httpParsedHeaders; + return $this->httpParsedHeaders; } /** @@ -448,7 +448,7 @@ class CalDAVClient { if ( $etag != null ) { $this->SetMatch( ($etag != '*'), $etag ); } - $this->SetContentType('text/calendar; encoding="utf-8"'); + $this->SetContentType('text/calendar; charset="utf-8"'); $this->DoRequest($url); $etag = null;