Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added the id in the serialized user

  • Loading branch information...
commit e1f5b11ba77bb24f2d47054e7ea41e0ba8c1e2a2 1 parent c3ffc16
@stof stof authored
Showing with 13 additions and 2 deletions.
  1. +4 −0 Changelog.md
  2. +9 −2 Model/User.php
View
4 Changelog.md
@@ -1,6 +1,10 @@
Changelog
=========
+### 1.2.3 (2012-07-10)
+
+* Fixed the serialization of users to include the id
+
### 1.2.2 (2012-07-10)
* Fixed a bug in the previous fix
View
11 Model/User.php
@@ -210,6 +210,7 @@ public function serialize()
$this->locked,
$this->credentialsExpired,
$this->enabled,
+ $this->id,
));
}
@@ -220,6 +221,11 @@ public function serialize()
*/
public function unserialize($serialized)
{
+ $data = unserialize($serialized);
+ // add a few extra elements in the array to ensure that we have enough keys when unserializing
+ // older data which does not include all properties.
+ $data = array_merge($data, array_fill(0, 2, null));
+
list(
$this->password,
$this->salt,
@@ -228,8 +234,9 @@ public function unserialize($serialized)
$this->expired,
$this->locked,
$this->credentialsExpired,
- $this->enabled
- ) = unserialize($serialized);
+ $this->enabled,
+ $this->id
+ ) = $data;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.