Skip to content

Commit 357e48c

Browse files
committed
Tweaking get() method of session store so that new and old input are also retrieved using array_get.
Signed-off-by: Ben Corlett <[email protected]>
1 parent 5dad849 commit 357e48c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Illuminate/Session/Store.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,17 @@ public function get($key, $default = null)
215215
// Session flash data is only persisted for the next request into the app
216216
// which makes it convenient for temporary status messages or various
217217
// other strings. We'll check all of this flash data for the items.
218-
if (isset($data[':new:'][$key]))
218+
if ($value = array_get($data, ":new:.$key"))
219219
{
220-
return $data[':new:'][$key];
220+
return $value;
221221
}
222222

223223
// The "old" flash data are the data flashed during the previous request
224224
// while the "new" data is the data flashed during the course of this
225225
// current request. Usually developers will be retrieving the olds.
226-
elseif (isset($data[':old:'][$key]))
226+
if ($value = array_get($data, ":old:.$key"))
227227
{
228-
return $data[':old:'][$key];
228+
return $value;
229229
}
230230

231231
return $default instanceof Closure ? $default() : $default;

0 commit comments

Comments
 (0)