Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
06bf0a40
Commit
06bf0a40
authored
Nov 01, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring the session payload.
parent
82b75166
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
payload.php
laravel/session/payload.php
+5
-14
No files found.
laravel/session/payload.php
View file @
06bf0a40
...
@@ -236,20 +236,11 @@ class Payload {
...
@@ -236,20 +236,11 @@ class Payload {
if
(
strpos
(
$key
,
':old:'
)
===
0
)
$this
->
forget
(
$key
);
if
(
strpos
(
$key
,
':old:'
)
===
0
)
$this
->
forget
(
$key
);
}
}
$this
->
replace
(
':new:'
,
':old:'
,
array_keys
(
$this
->
session
[
'data'
]));
// Now that all of the "old" keys have been removed from the session data,
}
// we can re-address all of the newly flashed keys to have old addresses.
// The array_combine method uses the first array for keys, and the second
/**
// array for values to construct a single array from both.
* Re-address the session data by performing a string replacement on the keys.
$keys
=
str_replace
(
':new'
,
':old:'
,
array_keys
(
$this
->
session
[
'data'
]));
*
* @param string $search
* @param string $replace
* @param array $keys
* @return void
*/
protected
function
replace
(
$search
,
$replace
,
$keys
)
{
$keys
=
str_replace
(
$search
,
$replace
,
$keys
);
$this
->
session
[
'data'
]
=
array_combine
(
$keys
,
array_values
(
$this
->
session
[
'data'
]));
$this
->
session
[
'data'
]
=
array_combine
(
$keys
,
array_values
(
$this
->
session
[
'data'
]));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment