Compare commits

...

2 Commits

Author SHA1 Message Date
Nick v H
63128ae2fd Merge branch 'master' into 'master'
Enclose XML response to only contain the XML tags (trimming any possible...

See merge request davical-project/davical!82
2025-01-26 14:22:46 +00:00
Nick v H
5920fe1efe Enclose XML response to only contain the XML tags (trimming any possible trailing characters after the last XML tag) 2021-09-20 19:04:42 +00:00

View File

@ -119,12 +119,13 @@ class CalDAVClient {
*/
function ParseResponse( $response ) {
$pos = strpos($response, '<?xml');
$epos = strrpos($response, '>');
if ($pos === false) {
$this->httpResponse = trim($response);
}
else {
$this->httpResponse = trim(substr($response, 0, $pos));
$this->xmlResponse = trim(substr($response, $pos));
$this->xmlResponse = trim(substr($response, $pos, $epos-$pos+1));
}
}