From db4c599af6f89823c9acf01752e38b7925ce2e77 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Sat, 27 Aug 2011 18:07:30 +0200 Subject: [PATCH] Use DOMDocument to retrieve the value in DateTimeTypeConverter --- Converter/DateTimeTypeConverter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Converter/DateTimeTypeConverter.php b/Converter/DateTimeTypeConverter.php index da84758..47a9ace 100644 --- a/Converter/DateTimeTypeConverter.php +++ b/Converter/DateTimeTypeConverter.php @@ -31,7 +31,10 @@ class DateTimeTypeConverter implements TypeConverterInterface public function convertXmlToPhp(SoapRequest $request, $data) { - return new \DateTime(strip_tags($data)); + $doc = new \DOMDocument(); + $doc->loadXML($data); + + return new \DateTime($doc->textContent); } public function convertPhpToXml(SoapResponse $response, $data)