]> BookStack Code Mirror - bookstack/blobdiff - app/Util/CspService.php
Fixed OIDC Logout
[bookstack] / app / Util / CspService.php
index ba927c93b29556b8949fd365aca6892f8fa10eb4..227ec8e0b3db683d0b17d98c3139feac406bc371 100644 (file)
@@ -22,7 +22,7 @@ class CspService
     }
 
     /**
-     * Get the CSP headers for the application
+     * Get the CSP headers for the application.
      */
     public function getCspHeader(): string
     {
@@ -86,6 +86,7 @@ class CspService
     {
         $iframeHosts = $this->getAllowedIframeHosts();
         array_unshift($iframeHosts, "'self'");
+
         return 'frame-ancestors ' . implode(' ', $iframeHosts);
     }
 
@@ -97,6 +98,7 @@ class CspService
     {
         $iframeHosts = $this->getAllowedIframeSources();
         array_unshift($iframeHosts, "'self'");
+
         return 'frame-src ' . implode(' ', $iframeHosts);
     }
 
@@ -124,7 +126,7 @@ class CspService
 
     protected function getAllowedIframeHosts(): array
     {
-        $hosts = config('app.iframe_hosts', '');
+        $hosts = config('app.iframe_hosts') ?? '';
 
         return array_filter(explode(' ', $hosts));
     }