From 031ab93e9727c79bafc81432db070025e1cac0f4 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sat, 26 Apr 2008 06:31:36 +0000 Subject: [PATCH] Merged revisions 52120 via svnmerge from http://svn.silverstripe.com/open/modules/sapphire/branches/govtsecurity ........ r52120 | sminnee | 2008-04-03 21:40:18 +1300 (Thu, 03 Apr 2008) | 1 line Fix operation of Cookie::forceExpiry() during testing. ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53464 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Cookie.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/Cookie.php b/core/Cookie.php index 0934e9055..6da4d7bc6 100755 --- a/core/Cookie.php +++ b/core/Cookie.php @@ -34,7 +34,9 @@ class Cookie extends Object { } static function forceExpiry( $name ) { - setcookie( $name, null, time() - 86400 ); + if(!headers_sent($file, $line)) { + setcookie( $name, null, time() - 86400 ); + } } }