From 527446a3d1e716769cfc5969bfa2858bf9dee50f Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Wed, 28 Jul 2010 21:29:12 -0300 Subject: [PATCH] Changing the RequestHandler to use new Xml class. --- cake/libs/controller/components/request_handler.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 2a9e42ac5..50e7ffc9d 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -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); } } }