X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FReport%2FUtils%2FReport.php;h=329bf0f83575839696effa228a7d25970cfdb0f8;hb=914d3734262de491f6a98f84cd5b78c48c7dd365;hp=f575d1f0639d2a10a1856c2d8642f2a6a5413292;hpb=61e836bd26506d43c2ebf3f8f3074e6e34702fed;p=civicrm-core.git diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index f575d1f063..329bf0f835 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -99,7 +99,7 @@ WHERE TRIM(BOTH '/' FROM CONCAT(report_id, '/', name)) = %1"; $params = [1 => [$path, 'String']]; $valId[$path] = CRM_Core_DAO::singleValueQuery($sql, $params); } - return CRM_Utils_Array::value($path, $valId); + return $valId[$path] ?? NULL; } /** @@ -212,6 +212,10 @@ WHERE inst.report_id = %1"; //Force a download and name the file using the current timestamp. $datetime = date('Ymd-Gi', $_SERVER['REQUEST_TIME']); CRM_Utils_System::setHttpHeader('Content-Disposition', 'attachment; filename=Report_' . $datetime . '.csv'); + // Output UTF BOM so that MS Excel copes with diacritics. This is recommended as + // the Windows variant but is tested with MS Excel for Mac (Office 365 v 16.31) + // and it continues to work on Libre Office, Numbers, Notes etc. + echo "\xEF\xBB\xBF"; echo self::makeCsv($form, $rows); CRM_Utils_System::civiExit(); }