diff --git a/core/control/Director.php b/core/control/Director.php index 677730a4e..cf6927783 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 3c29b67d6..c1c1f7db2 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();