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:
Ingo Schommer 2010-10-15 01:22:25 +00:00
parent 8d27740cf9
commit 0b3ff09e7e

View File

@ -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.