mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
moving data conversion for xml from Model::set() to RequestHandler::startup();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4277 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
7019ee7d26
commit
790689fc32
2 changed files with 6 additions and 5 deletions
|
@ -218,7 +218,12 @@ class RequestHandlerComponent extends Object {
|
|||
if (!class_exists('xmlnode') && !class_exists('XMLNode')) {
|
||||
uses('xml');
|
||||
}
|
||||
$controller->data = new XML(trim(file_get_contents('php://input')));
|
||||
$xml = new XML(trim(file_get_contents('php://input')));
|
||||
if (is_object($xml->child('data')) && count($xml->children) == 1) {
|
||||
$controller->data = $xml->child('data');
|
||||
} else {
|
||||
$controller->data = $xml;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -727,10 +727,6 @@ class Model extends Overloadable {
|
|||
if (is_object($one->child(Inflector::underscore($this->name)))) {
|
||||
$one = $one->child(Inflector::underscore($this->name));
|
||||
$one = $one->attributes;
|
||||
} else if (is_object($one->child('data'))) {
|
||||
$one = $one->child('data');
|
||||
$one = $one->child(Inflector::underscore($this->name));
|
||||
$one = $one->attributes;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue