Merge branch 'master' into 2.5

This commit is contained in:
mark_story 2013-11-01 16:54:57 -04:00
commit afd182898f
4 changed files with 7 additions and 4 deletions

View file

@ -558,7 +558,7 @@ class CookieComponent extends Component {
$first = substr($string, 0, 1);
if ($first === '{' || $first === '[') {
$ret = json_decode($string, true);
return ($ret) ? $ret : $string;
return ($ret !== null) ? $ret : $string;
}
$array = array();
foreach (explode(',', $string) as $pair) {

View file

@ -326,7 +326,8 @@ class Postgres extends DboSource {
$fullTable = $this->fullTableName($table);
$sequence = $this->value($this->getSequence($tableName, $column));
$this->execute("SELECT setval($sequence, (SELECT MAX(id) FROM $fullTable))");
$column = $this->name($column);
$this->execute("SELECT setval($sequence, (SELECT MAX($column) FROM $fullTable))");
return true;
}

View file

@ -601,12 +601,14 @@ class CookieComponentTest extends CakeTestCase {
$_COOKIE['CakeTestCookie'] = array(
'JSON' => '{"name":"value"}',
'Empty' => '',
'String' => '{"somewhat:"broken"}'
'String' => '{"somewhat:"broken"}',
'Array' => '{}'
);
$this->assertEquals(array('name' => 'value'), $this->Cookie->read('JSON'));
$this->assertEquals('value', $this->Cookie->read('JSON.name'));
$this->assertEquals('', $this->Cookie->read('Empty'));
$this->assertEquals('{"somewhat:"broken"}', $this->Cookie->read('String'));
$this->assertEquals(array(), $this->Cookie->read('Array'));
}
/**

View file

@ -136,7 +136,7 @@ class PaginatorHelper extends AppHelper {
/**
* Convenience access to any of the paginator params.
*
* @param string $key Key of the paginator params array to retreive.
* @param string $key Key of the paginator params array to retrieve.
* @param string $model Optional model name. Uses the default if none is specified.
* @return mixed Content of the requested param.
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::params