mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Checking for headers_sent() before setting cookies in Versioned::choose_site_stage() to avoid problems with URL parameters like showqueries=1 and ContentController calling choose_site_stage() (fixes #5557)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@105027 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0960bdd76a
commit
a6c968b3f3
@ -618,10 +618,12 @@ class Versioned extends DataObjectDecorator {
|
||||
Versioned::reading_stage("Live");
|
||||
}
|
||||
|
||||
if(Versioned::current_stage() == 'Live') {
|
||||
Cookie::set('bypassStaticCache', null, 0);
|
||||
} else {
|
||||
Cookie::set('bypassStaticCache', '1', 0);
|
||||
if(!headers_sent()) {
|
||||
if(Versioned::current_stage() == 'Live') {
|
||||
Cookie::set('bypassStaticCache', null, 0);
|
||||
} else {
|
||||
Cookie::set('bypassStaticCache', '1', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user