From 956d2f841cc8091eae824cba08c8787382a29353 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 7 Oct 2015 14:05:35 -0400 Subject: [PATCH] CRM-12527 - Additional header fixes --- CRM/Mailing/Page/View.php | 6 +++--- Civi/Angular/Page/Modules.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CRM/Mailing/Page/View.php b/CRM/Mailing/Page/View.php index 3bc78a2add..49c75879a1 100644 --- a/CRM/Mailing/Page/View.php +++ b/CRM/Mailing/Page/View.php @@ -172,14 +172,14 @@ class CRM_Mailing_Page_View extends CRM_Core_Page { $title = NULL; if (isset($this->_mailing->body_html) && empty($_GET['text'])) { - $header = 'Content-Type: text/html; charset=utf-8'; + $header = 'text/html; charset=utf-8'; $content = $mime->getHTMLBody(); if (strpos($content, '') === FALSE && strpos($content, '') === FALSE) { $title = '<head><title>' . $this->_mailing->subject . ''; } } else { - $header = 'Content-Type: text/plain; charset=utf-8'; + $header = 'text/plain; charset=utf-8'; $content = $mime->getTXTBody(); } CRM_Utils_System::setTitle($this->_mailing->subject); @@ -188,7 +188,7 @@ class CRM_Mailing_Page_View extends CRM_Core_Page { CRM_Core_Page_AJAX::returnJsonResponse($content); } if ($print) { - header($header); + CRM_Utils_System::setHttpHeader('Content-Type', $header); print $title; print $content; CRM_Utils_System::civiExit(); diff --git a/Civi/Angular/Page/Modules.php b/Civi/Angular/Page/Modules.php index 7526773bd2..2fc3d86368 100644 --- a/Civi/Angular/Page/Modules.php +++ b/Civi/Angular/Page/Modules.php @@ -132,9 +132,9 @@ class Modules extends \CRM_Core_Page { public function send($type, $data) { // Encourage browsers to cache for a long time - 1 year $ttl = 60 * 60 * 24 * 364; - header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $ttl)); - header("Content-Type: $type"); - header("Cache-Control: max-age=$ttl, public"); + \CRM_Utils_System::setHttpHeader('Expires', gmdate('D, d M Y H:i:s \G\M\T', time() + $ttl)); + \CRM_Utils_System::setHttpHeader("Content-Type", $type); + \CRM_Utils_System::setHttpHeader("Cache-Control", "max-age=$ttl, public"); echo $data; } -- 2.25.1