Merge branch '2.1' into 2.2

Conflicts:
	lib/Cake/VERSION.txt
This commit is contained in:
mark_story 2012-05-26 21:11:36 -04:00
commit 4b8c469004
5 changed files with 22 additions and 3 deletions

View file

@ -470,6 +470,9 @@ class CakeSession {
if (!empty($sessionConfig['handler'])) { if (!empty($sessionConfig['handler'])) {
$sessionConfig['ini']['session.save_handler'] = 'user'; $sessionConfig['ini']['session.save_handler'] = 'user';
} }
if (!isset($sessionConfig['ini']['session.gc_maxlifetime'])) {
$sessionConfig['ini']['session.gc_maxlifetime'] = $sessionConfig['timeout'] * 60;
}
if (empty($_SESSION)) { if (empty($_SESSION)) {
if (!empty($sessionConfig['ini']) && is_array($sessionConfig['ini'])) { if (!empty($sessionConfig['ini']) && is_array($sessionConfig['ini'])) {

View file

@ -615,7 +615,7 @@ class CakeRequest implements ArrayAccess {
/** /**
* Get the host that the request was handled on. * Get the host that the request was handled on.
* *
* @return void * @return string
*/ */
public function host() { public function host() {
return env('HTTP_HOST'); return env('HTTP_HOST');

View file

@ -737,6 +737,8 @@ class CakeSessionTest extends CakeTestCase {
TestCakeSession::start(); TestCakeSession::start();
$this->assertEquals(400, Configure::read('Session.cookieTimeout')); $this->assertEquals(400, Configure::read('Session.cookieTimeout'));
$this->assertEquals(400, Configure::read('Session.timeout')); $this->assertEquals(400, Configure::read('Session.timeout'));
$this->assertEquals(400 * 60, ini_get('session.cookie_lifetime'));
$this->assertEquals(400 * 60, ini_get('session.gc_maxlifetime'));
$_SESSION = null; $_SESSION = null;
Configure::write('Session', array( Configure::write('Session', array(

View file

@ -1614,6 +1614,20 @@ class SetTest extends CakeTestCase {
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
} }
/**
* test classicExtract with keys that exceed 32bit max int.
*
* @return void
*/
public function testClassicExtractMaxInt() {
$data = array(
'Data' => array(
'13376924712' => 'abc'
)
);
$this->assertEquals('abc', Set::classicExtract($data, 'Data.13376924712'));
}
/** /**
* testInsert method * testInsert method
* *

View file

@ -561,8 +561,8 @@ class Set {
foreach ($path as $i => $key) { foreach ($path as $i => $key) {
if (is_numeric($key) && intval($key) > 0 || $key === '0') { if (is_numeric($key) && intval($key) > 0 || $key === '0') {
if (isset($data[intval($key)])) { if (isset($data[$key])) {
$data = $data[intval($key)]; $data = $data[$key];
} else { } else {
return null; return null;
} }