Permalink
Browse files

Merge branch 'hotfix/3793' into develop

Forward port #3793
  • Loading branch information...
weierophinney committed Feb 19, 2013
2 parents 8cb221d + 20ef11f commit 896a19b485d0db560fe89a38fa2aa92ae5ce84e1
@@ -22,11 +22,7 @@ class SessionArrayStorage extends AbstractSessionArrayStorage
*/
public function &__get($key)
{
- if (isset($_SESSION[$key])) {
- return $_SESSION[$key];
- }
-
- return null;
+ return $_SESSION[$key];
}
/**
@@ -37,10 +33,6 @@ public function &__get($key)
*/
public function &offsetGet($key)
{
- if (isset($_SESSION[$key])) {
- return $_SESSION[$key];
- }
-
- return null;
+ return $_SESSION[$key];
}
}
@@ -145,4 +145,25 @@ public function testToArrayWithMetaData()
$this->assertSame($expected, $this->storage->toArray(true));
}
+ public function testUndefinedSessionManipulation()
+ {
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
+ $this->markTestSkipped('Known issue on versions of PHP less than 5.3.4');
+ }
+
+ $this->storage['foo'] = 'bar';
+ $this->storage['bar'][] = 'bar';
+ $this->storage['baz']['foo'] = 'bar';
+
+ $expected = array(
+ '__ZF' => array(
+ '_REQUEST_ACCESS_TIME' => $this->storage->getRequestAccessTime(),
+ ),
+ 'foo' => 'bar',
+ 'bar' => array('bar'),
+ 'baz' => array('foo' => 'bar'),
+ );
+ $this->assertSame($expected, $this->storage->toArray(true));
+ }
+
}

0 comments on commit 896a19b

Please sign in to comment.