| @@ -85,15 +85,17 @@ | ||
| 85 | 85 | // do not cache |
| 86 | 86 | return $user; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | + $key = (int) $id; | |
| 90 | + | |
| 89 | 91 | // cache user object |
| 90 | - if (!isset(static::$instances[$id])) | |
| 92 | + if (!isset(static::$instances[$key])) | |
| 91 | 93 | { |
| 92 | - static::$instances[$id] = $user; | |
| 94 | + static::$instances[$key] = $user; | |
| 93 | 95 | } |
| 94 | 96 | |
| 95 | - return static::$instances[$id]; | |
| 97 | + return static::$instances[$key]; | |
| 96 | 98 | } |
| 97 | 99 | |
| 98 | 100 | /** |
| 99 | 101 | * Magic method to access internal properties. |