Skip to content

Commit

Permalink
Merge branch 'master' into 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 1, 2013
2 parents f3284d9 + d8acf53 commit afd1828
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/CookieComponent.php
Expand Up @@ -558,7 +558,7 @@ protected function _explode($string) {
$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) {
Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -326,7 +326,8 @@ public function resetSequence($table, $column) {
$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;
}

Expand Down
Expand Up @@ -601,12 +601,14 @@ public function testReadEmpty() {
$_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'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/PaginatorHelper.php
Expand Up @@ -136,7 +136,7 @@ public function params($model = null) {
/**
* 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
Expand Down

0 comments on commit afd1828

Please sign in to comment.