From 6b9598bbea2cc702dc881e0b79370305c3ba7366 Mon Sep 17 00:00:00 2001 From: Evan Kaufman Date: Mon, 29 Aug 2016 10:34:00 -0700 Subject: [PATCH] Added isset check before HTTPS check Fixes #159 --- src/Genesis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Genesis.php b/src/Genesis.php index a951832..d22ccb9 100644 --- a/src/Genesis.php +++ b/src/Genesis.php @@ -22,7 +22,7 @@ public static function rewriteUrls() update_option('upload_path', null); $old_url = site_url(); - $new_url = ($_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; + $new_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; // Ensure internal WordPress functions map correctly to new url (but don't want to persist in the DB) add_filter('option_home', function($value) use ($old_url, $new_url) { return str_replace($old_url, $new_url, $value); });