Merge pull request #2484 from ADmad/2.5-cookiecomponent

Revert change done in 11f543f1f2.
This commit is contained in:
José Lorenzo Rodríguez 2013-12-15 07:32:12 -08:00
commit b5d7628cbf
2 changed files with 8 additions and 4 deletions

View file

@ -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==.";

View file

@ -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);
}
/**