Skip to content

Commit

Permalink
Merge pull request #1096 from jefft/fix-contactlist
Browse files Browse the repository at this point in the history
Fix #1054 - our tempfile must have a .docx extension for later filetype inferral.
  • Loading branch information
tbar0970 authored Nov 15, 2024
2 parents 61b0046 + 71a2efc commit ccf3007
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion views/view_2_families__4_contact_list.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ public function printDOCX()
}
if (file_exists($templateFilename)) {
require_once 'include/odf_tools.class.php';
$outname = tempnam(sys_get_temp_dir(), 'contactlist-docx-');
$outname = tempnam(sys_get_temp_dir(), 'contactlist');
rename($outname, $outname.".docx"); // replaceKeywords() relies on the extension to know the filetype.
$outname = $outname.".docx";
copy($templateFilename, $outname);
ODF_Tools::insertFileIntoFile($tempname, $outname, '%CONTACT_LIST%');
$replacements = Array('SYSTEM_NAME' => SYSTEM_NAME, 'MONTH' => date('F Y'));
Expand Down

0 comments on commit ccf3007

Please sign in to comment.