Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
056e5478
Commit
056e5478
authored
May 17, 2012
by
Ben Corlett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding output buffering to allow redirects to work after content has been outputted.
Signed-off-by: Ben Corlett <bencorlett@me.com>
parent
a6ad5c6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
laravel/core.php
+14
-0
laravel/redirect.php
+20
-0
No files found.
laravel/core.php
View file @
056e5478
...
...
@@ -19,6 +19,20 @@ define('MB_STRING', (int) function_exists('mb_get_info'));
/*
|--------------------------------------------------------------------------
| Start Output Buffering
|--------------------------------------------------------------------------
|
| Output buffering allows us to capture all output at any time, so that we
| can discard it or treat it accordingly. An example of this is if you have
| echoed a string, but want to return a Redirect object. Because Symphony
| only checks if headers have been sent, your redirect just silently fails.
|
*/
ob_start
();
/*
|--------------------------------------------------------------------------
| Require Core Classes
|--------------------------------------------------------------------------
|
...
...
laravel/redirect.php
View file @
056e5478
...
...
@@ -165,4 +165,23 @@ class Redirect extends Response {
return
$this
->
with
(
'errors'
,
$errors
);
}
/**
* Send the headers and content of the response to the browser.
*
* @return void
*/
public
function
send
()
{
// Dump all output buffering, this ensures
// that symphony will send our redirect headers
// properly if we've outputted any content from
// within Laravel.
while
(
ob_get_level
()
>
0
)
{
ob_end_clean
();
}
return
parent
::
send
();
}
}
\ No newline at end of file
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