Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing real issue for Ticket #137

Reverted changes replacing [ and ] with .
  • Loading branch information...
commit a1ce9e662c67b399ae06e5e7fcbe7f1e11b18e5e 1 parent 7bead5d
@phpnut phpnut authored
Showing with 11 additions and 6 deletions.
  1. +11 −6 cake/libs/controller/components/cookie.php
View
17 cake/libs/controller/components/cookie.php
@@ -215,7 +215,7 @@ 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);
@@ -223,7 +223,7 @@ function write($key, $value = null, $encrypt = true, $expires = null) {
$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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.