Skip to content

Commit e92aed9

Browse files
committed
[smarcet]
* fix on cdata parsing * fix on vcard response
1 parent 133f505 commit e92aed9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Facade/Responses/AbstractCalDAVResponse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public function __construct($server_url = null, $body = null, $code = HttpRespon
4848
$this->server_url = $server_url;
4949
if(!empty($this->body)) {
5050
$this->stripped = $this->stripNamespacesFromTags($this->body);
51-
$this->xml = simplexml_load_string($this->stripped);
51+
// Merge CDATA as text nodes
52+
$this->xml = simplexml_load_string($this->stripped, null, LIBXML_NOCDATA);
5253
if($this->xml === FALSE)
5354
throw new XMLResponseParseException();
5455
$this->content = $this->toAssocArray($this->xml);

src/Facade/Responses/VCardEntityResponse.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class VCardEntityResponse extends ETagEntityResponse
2222
* @return string
2323
*/
2424
public function getVCard(){
25-
return isset($this->found_props['calendar-data']) ? $this->found_props['calendar-data'] : null;
25+
if(!isset($this->found_props['calendar-data'])) return null;
26+
$calendar_data = $this->found_props['calendar-data'];
27+
if(!is_string($calendar_data)) return null;
28+
return $calendar_data;
2629
}
2730
}

0 commit comments

Comments
 (0)