mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merge branch 'master' into 2.5
This commit is contained in:
commit
afd182898f
4 changed files with 7 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue