mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #2484 from ADmad/2.5-cookiecomponent
Revert change done in 11f543f1f2
.
This commit is contained in:
commit
b5d7628cbf
2 changed files with 8 additions and 4 deletions
|
@ -472,7 +472,7 @@ class CookieComponent extends Component {
|
|||
if (is_array($value)) {
|
||||
$value = $this->_implode($value);
|
||||
}
|
||||
if (!$this->_encrypted || !$value) {
|
||||
if (!$this->_encrypted) {
|
||||
return $value;
|
||||
}
|
||||
$prefix = "Q2FrZQ==.";
|
||||
|
|
|
@ -202,11 +202,11 @@ class CookieComponentTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* test write() Encrypted data with null & empty string & boolean value
|
||||
* test write() encrypted data with falsey value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testWriteWithNullEmptyString() {
|
||||
public function testWriteWithFalseyValue() {
|
||||
$this->Cookie->type('aes');
|
||||
$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#HKis~#^';
|
||||
|
||||
|
@ -228,7 +228,11 @@ class CookieComponentTest extends CakeTestCase {
|
|||
|
||||
$this->Cookie->write('Testing', '0');
|
||||
$result = $this->Cookie->read('Testing');
|
||||
$this->assertEquals('0', $result);
|
||||
$this->assertSame('0', $result);
|
||||
|
||||
$this->Cookie->write('Testing', 0);
|
||||
$result = $this->Cookie->read('Testing');
|
||||
$this->assertSame(0, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue