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) (from r105027)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112435 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8d27740cf9
commit
0b3ff09e7e
@ -618,12 +618,14 @@ class Versioned extends DataObjectDecorator {
|
||||
Versioned::reading_stage("Live");
|
||||
}
|
||||
|
||||
if(!headers_sent()) {
|
||||
if(Versioned::current_stage() == 'Live') {
|
||||
Cookie::set('bypassStaticCache', null, 0);
|
||||
} else {
|
||||
Cookie::set('bypassStaticCache', '1', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current reading mode.
|
||||
|
Loading…
Reference in New Issue
Block a user