Skip to content

Commit 1c4efe5

Browse files
committed
Merge pull request #417 from bencorlett/feature/session-missing-dot-notation
Using array_set() in Session::flash() for consistency.
2 parents 130864d + a3c722f commit 1c4efe5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Illuminate/Session/Store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public function put($key, $value)
296296
*/
297297
public function flash($key, $value)
298298
{
299-
$this->session['data'][':new:'][$key] = $value;
299+
array_set($this->session['data'][':new:'], $key, $value);
300300
}
301301

302302
/**

tests/Session/SessionStoreTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ public function testComplexArrayPayloadManipulation()
238238
$store->forget('foo.bat');
239239
$this->assertEquals(array('bar' => 'baz'), $store->get('foo'));
240240
$this->assertFalse($store->has('foo.bat'));
241+
$store->flash('flash.foo', 'bar');
242+
$this->assertEquals(array('foo' => 'bar'), $store->get('flash'));
243+
$store->forget('flash');
241244
}
242245

243246

0 commit comments

Comments
 (0)