mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Changing the RequestHandler to use new Xml class.
This commit is contained in:
parent
53f8353f92
commit
527446a3d1
1 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue