diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php index 502b99395..509eabcb1 100644 --- a/lib/Cake/Model/Datasource/CakeSession.php +++ b/lib/Cake/Model/Datasource/CakeSession.php @@ -470,6 +470,9 @@ class CakeSession { if (!empty($sessionConfig['handler'])) { $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($sessionConfig['ini']) && is_array($sessionConfig['ini'])) { diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index 82f213986..62b1cf291 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -615,7 +615,7 @@ class CakeRequest implements ArrayAccess { /** * Get the host that the request was handled on. * - * @return void + * @return string */ public function host() { return env('HTTP_HOST'); diff --git a/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php b/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php index 70a180235..a2276972f 100644 --- a/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php @@ -737,6 +737,8 @@ class CakeSessionTest extends CakeTestCase { TestCakeSession::start(); $this->assertEquals(400, Configure::read('Session.cookieTimeout')); $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; Configure::write('Session', array( diff --git a/lib/Cake/Test/Case/Utility/SetTest.php b/lib/Cake/Test/Case/Utility/SetTest.php index 4960a139d..b7815175a 100644 --- a/lib/Cake/Test/Case/Utility/SetTest.php +++ b/lib/Cake/Test/Case/Utility/SetTest.php @@ -1614,6 +1614,20 @@ class SetTest extends CakeTestCase { $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 * diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php index 916e7f73b..178df69b7 100644 --- a/lib/Cake/Utility/Set.php +++ b/lib/Cake/Utility/Set.php @@ -561,8 +561,8 @@ class Set { foreach ($path as $i => $key) { if (is_numeric($key) && intval($key) > 0 || $key === '0') { - if (isset($data[intval($key)])) { - $data = $data[intval($key)]; + if (isset($data[$key])) { + $data = $data[$key]; } else { return null; }