Skip to content

Commit

Permalink
Fixed an issue with certain characters in the returned xml
Browse files Browse the repository at this point in the history
  • Loading branch information
Garethp committed Jun 24, 2020
1 parent 4b6fbdc commit 88d4228
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/scopes/scope_settings.xml

This file was deleted.

3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 0.9.7 - TBD
## 0.9.7 - 2020-06-24
* Added a `$options = []` parameter to various methods
* Made `ExchangeWebServices::drillDownResponses()` static
* Added a `NotificationAPI::handlePushNotification()` method
Expand All @@ -11,6 +11,7 @@
* Adding a simple usage for `setFrom`
* `CalendarAPI::areAvailable` will now check for an error and throw a useful Exception
* Updated the Restriction format to allow for multiple If's and nexted And's/Or's
* Fixed an issue with certain characters in the XML (Issue #180)

## 0.9.6 - 2018-01-26
* Added an `options` parameter to `CalendarAPI::updateCalendarItem()`
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"require": {
"garethp/http-playback": "^1.0",
"ext-curl": "*",
"ext-soap": "*"
"ext-soap": "*",
"ext-libxml": "*",
"ext-dom": "*",
"ext-simplexml": "*"
},
"scripts": {
"cs": "./vendor/bin/phpcs --standard=ruleset.xml -np src/ tests/ examples/",
Expand Down
13 changes: 12 additions & 1 deletion src/API/NTLMSoapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,18 @@ public function __doRequest($request, $location, $action, $version, $one_way = 0
$this->__last_request_headers = $postOptions['headers'];
$this->_responseCode = $response->getStatusCode();

return $response->getBody()->__toString();
$responseStr = $response->getBody()->__toString();
libxml_use_internal_errors(true);
$dom = new \DOMDocument("1.0", "UTF-8");
$dom->strictErrorChecking = false;
$dom->validateOnParse = false;
$dom->recover = true;
$dom->loadXML($responseStr);
$xml = simplexml_import_dom($dom);
libxml_clear_errors();
libxml_use_internal_errors(false);

return $xml->asXML();
}

/**
Expand Down

0 comments on commit 88d4228

Please sign in to comment.