Skip to content

Commit

Permalink
[smarcet]
Browse files Browse the repository at this point in the history
* fix on cdata parsing
* fix on vcard response
  • Loading branch information
smarcet committed Oct 9, 2018
1 parent 133f505 commit e92aed9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Facade/Responses/AbstractCalDAVResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public function __construct($server_url = null, $body = null, $code = HttpRespon
$this->server_url = $server_url;
if(!empty($this->body)) {
$this->stripped = $this->stripNamespacesFromTags($this->body);
$this->xml = simplexml_load_string($this->stripped);
// Merge CDATA as text nodes
$this->xml = simplexml_load_string($this->stripped, null, LIBXML_NOCDATA);
if($this->xml === FALSE)
throw new XMLResponseParseException();
$this->content = $this->toAssocArray($this->xml);
Expand Down
5 changes: 4 additions & 1 deletion src/Facade/Responses/VCardEntityResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class VCardEntityResponse extends ETagEntityResponse
* @return string
*/
public function getVCard(){
return isset($this->found_props['calendar-data']) ? $this->found_props['calendar-data'] : null;
if(!isset($this->found_props['calendar-data'])) return null;
$calendar_data = $this->found_props['calendar-data'];
if(!is_string($calendar_data)) return null;
return $calendar_data;
}
}

0 comments on commit e92aed9

Please sign in to comment.