Skip to content
Permalink
Browse files

Fixing notice errors caused by trying to operate on keys that don't e…

…xist.

Fixes #1651
  • Loading branch information...
markstory committed May 31, 2011
1 parent 9402f66 commit cd8b18d00db0c23281e7477264d4c826cd6ee0a6
@@ -291,7 +291,9 @@ function delete($key) {
return;
}
$names = explode('.', $key, 2);
$this->__values[$names[0]] = Set::remove($this->__values[$names[0]], $names[1]);
if (isset($this->__values[$names[0]])) {
$this->__values[$names[0]] = Set::remove($this->__values[$names[0]], $names[1]);
}
$this->__delete('[' . implode('][', $names) . ']');
}
@@ -468,6 +468,16 @@ function testDeleteRemovesChildren() {
$this->Controller->Cookie->destroy();
}
/**
* Test deleting recursively with keys that don't exist.
*
* @return void
*/
function testDeleteChildrenNotExist() {
$this->assertNull($this->Controller->Cookie->delete('NotFound'));
$this->assertNull($this->Controller->Cookie->delete('Not.Found'));
}
/**
* encrypt method
*

0 comments on commit cd8b18d

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.