From e7a7e3b00d48cce485e64ba316169c54971c4fe7 Mon Sep 17 00:00:00 2001
From: JediKev <kevin@enhancesoft.com>
Date: Fri, 29 Mar 2019 10:40:11 -0500
Subject: [PATCH] issue: iFrame On Install

This addresses the "Call to getAllowIframes() on NULL" error on installation
pages. This is due to 4781 that introduced the concept of allowing multiple
iFrames, where we are not checking for `$cfg` before calling the method.
This adds a check for `$cfg` so the errors do not occur.
---
 setup/inc/header.inc.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/setup/inc/header.inc.php b/setup/inc/header.inc.php
index 0bfc0ec85..900c143fa 100644
--- a/setup/inc/header.inc.php
+++ b/setup/inc/header.inc.php
@@ -1,5 +1,6 @@
 <?php
-header("Content-Security-Policy: frame-ancestors '".$cfg->getAllowIframes()."';");
+if ($cfg)
+    header("Content-Security-Policy: frame-ancestors '".$cfg->getAllowIframes()."';");
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">
-- 
GitLab