Permalink
Browse files

Added the id in the serialized user

  • Loading branch information...
1 parent c3ffc16 commit e1f5b11ba77bb24f2d47054e7ea41e0ba8c1e2a2 @stof stof committed Jul 10, 2012
Showing with 13 additions and 2 deletions.
  1. +4 −0 Changelog.md
  2. +9 −2 Model/User.php
View
@@ -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
@@ -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;
}
/**

0 comments on commit e1f5b11

Please sign in to comment.