Skip to content
Permalink
Browse files

Fixing real issue for Ticket #137

Reverted changes replacing [ and ] with .
  • Loading branch information...
phpnut committed Nov 4, 2009
1 parent 7bead5d commit a1ce9e662c67b399ae06e5e7fcbe7f1e11b18e5e
Showing with 11 additions and 6 deletions.
  1. +11 −6 cake/libs/controller/components/cookie.php
@@ -215,15 +215,15 @@ function write($key, $value = null, $encrypt = true, $expires = null) {
foreach ($key as $name => $value) {
if (strpos($name, '.') === false) {
$this->__values[$name] = $value;
$this->__write(".$name", $value);
$this->__write("[$name]", $value);
} else {
$names = explode('.', $name, 2);
if (!isset($this->__values[$names[0]])) {
$this->__values[$names[0]] = array();
}
$this->__values[$names[0]] = Set::insert($this->__values[$names[0]], $names[1], $value);
$this->__write("." . implode('.', $names), $value);
$this->__write('[' . implode('][', $names) . ']', $value);
}
}
$this->__encrypted = true;
@@ -289,12 +289,12 @@ function delete($key) {
}
if (strpos($key, '.') === false) {
unset($this->__values[$key]);
$this->__delete(".$key");
$this->__delete("[$key]");
return;
}
$names = explode('.', $key, 2);
$this->__values[$names[0]] = Set::remove($this->__values[$names[0]], $names[1]);
$this->__delete("." . implode('.', $names));
$this->__delete('[' . implode('][', $names) . ']');
}
/**
@@ -315,11 +315,11 @@ function destroy() {
if (is_array($value)) {
foreach ($value as $key => $val) {
unset($this->__values[$name][$key]);
$this->__delete(".$name.$key");
$this->__delete("[$name][$key]");
}
}
unset($this->__values[$name]);
$this->__delete(".$name");
$this->__delete("[$name]");
}
}
@@ -354,6 +354,11 @@ function __expire($expires = null) {
return $this->__expires;
}
$this->__reset = $this->__expires;
if ($expires == 0) {
return $this->__expires = 0;
}
if (is_integer($expires) || is_numeric($expires)) {
return $this->__expires = $now + intval($expires);
}

0 comments on commit a1ce9e6

Please sign in to comment.
You can’t perform that action at this time.