Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '1.3-misc' of github.com:cakephp/cakephp1x into 1.3-misc

  • Loading branch information...
commit 5046382e7d82fde289c309500032aabed4ecbb0b 2 parents 7dcf66d + 5f987a4
Mark Story markstory authored
6 cake/libs/controller/components/request_handler.php
View
@@ -219,10 +219,10 @@ function startup(&$controller) {
}
$xml = new Xml(trim(file_get_contents('php://input')));
- if (is_object($xml->child('data')) && count($xml->children) == 1) {
- $controller->data = $xml->child('data');
+ if (count($xml->children) == 1 && is_object($dataNode = $xml->child('data'))) {
+ $controller->data = $dataNode->toArray();
} else {
- $controller->data = $xml;
+ $controller->data = $xml->toArray();
}
}
}
8 cake/tests/cases/libs/controller/components/request_handler.test.php
View
@@ -241,8 +241,8 @@ function testStartupCallback() {
$_SERVER['REQUEST_METHOD'] = 'PUT';
$_SERVER['CONTENT_TYPE'] = 'application/xml';
$this->RequestHandler->startup($this->Controller);
- $this->assertTrue(is_object($this->Controller->data));
- $this->assertEqual(strtolower(get_class($this->Controller->data)), 'xml');
+ $this->assertTrue(is_array($this->Controller->data));
+ $this->assertFalse(is_object($this->Controller->data));
}
/**
@@ -254,8 +254,8 @@ function testStartupCallbackCharset() {
$_SERVER['REQUEST_METHOD'] = 'PUT';
$_SERVER['CONTENT_TYPE'] = 'application/xml; charset=UTF-8';
$this->RequestHandler->startup($this->Controller);
- $this->assertTrue(is_object($this->Controller->data));
- $this->assertEqual(strtolower(get_class($this->Controller->data)), 'xml');
+ $this->assertTrue(is_array($this->Controller->data));
+ $this->assertFalse(is_object($this->Controller->data));
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.