Commit a22129e7 authored by Francois Marier's avatar Francois Marier
Browse files

init: only redirect to HTTPS when running in a browser

The redirect to HTTPS added in 02cf299a

was causing problems when cron was running using PHP cli (bug #792290).

Change-Id: I991f51d2cc9272e5f33e5f4b7486d3565924d8c7
Signed-off-by: default avatarFrancois Marier <>
parent cd78d649
......@@ -204,7 +204,7 @@ if (isset($CFG->wwwroot)) {
// Make sure that we are using ssl if wwwroot expects us to do so
if ((!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') &&
if (isset($_SERVER['REMOTE_ADDR']) && (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') &&
parse_url($CFG->wwwroot, PHP_URL_SCHEME) === 'https'){
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment