$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, '<head>') === FALSE && strpos($content, '<title>') === FALSE) {
$title = '<head><title>' . $this->_mailing->subject . '</title></head>';
}
}
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);
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();
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;
}