<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
* @param mixed $input
*/
public static function output($input) {
- header('Content-Type: application/json');
+ CRM_Utils_System::setHttpHeader('Content-Type', 'application/json');
echo json_encode($input);
CRM_Utils_System::civiExit();
}
if ($addcomma) {
$sOutput .= ",";
}
- //CRM-7130 --lets addslashes to only double quotes,
- //since we are using it to quote the field value.
- //str_replace helps to provide a break for new-line
+ // CRM-7130 --lets addslashes to only double quotes,
+ // since we are using it to quote the field value.
+ // str_replace helps to provide a break for new-line
$sOutput .= '"' . addcslashes(str_replace(array("\r\n", "\n", "\r"), '<br />', $value[$element]), '"\\') . '"';
- //remove extra spaces and tab character that breaks dataTable CRM-12551
+ // remove extra spaces and tab character that breaks dataTable CRM-12551
$sOutput = preg_replace("/\s+/", " ", $sOutput);
$addcomma = TRUE;
}