mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Testing the build of XML. If it is invalid will generate a Exception.
This commit is contained in:
parent
c6c3295c5c
commit
cda0ce4727
1 changed files with 8 additions and 6 deletions
|
@ -175,13 +175,15 @@ class RequestHandlerComponent extends Component {
|
|||
if (!class_exists('Xml')) {
|
||||
App::import('Core', 'Xml');
|
||||
}
|
||||
$xml = Xml::build(trim(file_get_contents('php://input')));
|
||||
try {
|
||||
$xml = Xml::build(trim(file_get_contents('php://input')));
|
||||
|
||||
if (isset($xml->data)) {
|
||||
$controller->data = Xml::toArray($xml->data);
|
||||
} else {
|
||||
$controller->data = Xml::toArray($xml);
|
||||
}
|
||||
if (isset($xml->data)) {
|
||||
$controller->data = Xml::toArray($xml->data);
|
||||
} else {
|
||||
$controller->data = Xml::toArray($xml);
|
||||
}
|
||||
} catch (Exception $e) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue