From 6a83da1455c0c678936bb9091432ec86556fe4c8 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 19 Oct 2010 00:36:06 +0000 Subject: [PATCH] MINOR Fixed Director::forceSSL() breaking unit tests because headers were already sent (from r108435) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112749 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/Director.php | 2 +- tests/control/DirectorTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/control/Director.php b/core/control/Director.php index ef3b32421..ed260b08a 100755 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -646,7 +646,7 @@ class Director { if($matched && !isset($_SERVER['HTTPS'])) { $destURL = str_replace('http:', 'https:', Director::absoluteURL($_SERVER['REQUEST_URI'])); - header("Location: $destURL"); + if(!headers_sent()) header("Location: $destURL"); if(SapphireTest::is_running_test()) { return $destURL; } else { diff --git a/tests/control/DirectorTest.php b/tests/control/DirectorTest.php index bc5b0ead9..224c31256 100644 --- a/tests/control/DirectorTest.php +++ b/tests/control/DirectorTest.php @@ -5,7 +5,7 @@ * * @todo test Director::alternateBaseFolder() */ -class DirectorTest extends FunctionalTest { +class DirectorTest extends SapphireTest { function setUp() { parent::setUp();