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
8dbe2d1a
Commit
8dbe2d1a
authored
Aug 13, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #681 from bencorlett/develop
Added Output Buffering
parents
feb651f6
7f0d709b
Show 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 @
8dbe2d1a
...
@@ -19,6 +19,20 @@ define('MB_STRING', (int) function_exists('mb_get_info'));
...
@@ -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 Symfony
| only checks if headers have been sent, your redirect just silently fails.
|
*/
ob_start
(
'mb_output_handler'
);
/*
|--------------------------------------------------------------------------
| Require Core Classes
| Require Core Classes
|--------------------------------------------------------------------------
|--------------------------------------------------------------------------
|
|
...
...
laravel/redirect.php
View file @
8dbe2d1a
...
@@ -165,4 +165,23 @@ class Redirect extends Response {
...
@@ -165,4 +165,23 @@ class Redirect extends Response {
return
$this
->
with
(
'errors'
,
$errors
);
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