Skip to content

Commit

Permalink
Testing the build of XML. If it is invalid will generate a Exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Oct 25, 2010
1 parent c6c3295 commit cda0ce4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cake/libs/controller/components/request_handler.php
Expand Up @@ -175,13 +175,15 @@ public function startup(&$controller) {
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) {}
}
}

Expand Down

0 comments on commit cda0ce4

Please sign in to comment.