Use DOMDocument to retrieve the value in DateTimeTypeConverter

This commit is contained in:
Francis Besset 2011-08-27 18:07:30 +02:00
parent ce5c46408a
commit db4c599af6
1 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,10 @@ class DateTimeTypeConverter implements TypeConverterInterface
public function convertXmlToPhp(SoapRequest $request, $data) 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) public function convertPhpToXml(SoapResponse $response, $data)