Changing the RequestHandler to use new Xml class.

This commit is contained in:
Juan Basso 2010-07-28 21:29:12 -03:00
parent 53f8353f92
commit 527446a3d1

View file

@ -240,15 +240,15 @@ class RequestHandlerComponent extends Object {
}
if ($this->requestedWith('xml')) {
if (!class_exists('XmlNode')) {
if (!class_exists('Xml')) {
App::import('Core', 'Xml');
}
$xml = new Xml(trim(file_get_contents('php://input')));
$xml = Xml::build(trim(file_get_contents('php://input')));
if (count($xml->children) == 1 && is_object($dataNode = $xml->child('data'))) {
$controller->data = $dataNode->toArray();
if (isset($xml->data)) {
$controller->data = Xml::toArray($xml->data);
} else {
$controller->data = $xml->toArray();
$controller->data = Xml::toArray($xml);
}
}
}