BUGFIX: Don't force SSL when running from CLI (from r98272)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102639 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 03:19:00 +00:00
parent c07f3c8a8f
commit c5fda512d6

View File

@ -598,7 +598,7 @@ class Director {
* </code>
*/
static function forceSSL() {
if((!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') && !Director::isDev()) {
if((!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') && !Director::isDev() && !Director::is_cli()) {
$destURL = str_replace('http:', 'https:', Director::absoluteURL($_SERVER['REQUEST_URI']));
header("Location: $destURL", true, 301);