mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fix issue where values are not recursively deleted. ie:
$this->Cookie->write('User.email', 'test@example.com'); $this->Cookie->delete('User'); The cookie for User.email would not be removed (despite being removed from the __values array. Fixes #1651 Signed-off-by: mark_story <mark@mark-story.com>
This commit is contained in:
parent
bc5edebee6
commit
13c64f1707
1 changed files with 7 additions and 1 deletions
|
@ -281,8 +281,14 @@ class CookieComponent extends Object {
|
|||
$this->read();
|
||||
}
|
||||
if (strpos($key, '.') === false) {
|
||||
unset($this->__values[$key]);
|
||||
if(isset($this->__values[$key]) && is_array($this->__values[$key])) {
|
||||
foreach($this->__values[$key] as $idx => $val) {
|
||||
$this->__delete("[$key][$idx]");
|
||||
}
|
||||
} else {
|
||||
$this->__delete("[$key]");
|
||||
}
|
||||
unset($this->__values[$key]);
|
||||
return;
|
||||
}
|
||||
$names = explode('.', $key, 2);
|
||||
|
|
Loading…
Add table
Reference in a new issue