Skip to content

Commit

Permalink
Fix #1054 - our tempfile must have a .docx extension for later filety…
Browse files Browse the repository at this point in the history
…pe inferral.
  • Loading branch information
jefft committed Nov 13, 2024
1 parent 469a801 commit 71a2efc
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 71a2efc

Please sign in to comment.