X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fpdf_report.inc;h=115fa929d24ab9a34469ed9bffab0707fba42b7d;hb=59840905a38c4e08e5b13fdb7af71ea6dea7b1f0;hp=0fec40a9b406e7353def05ad8253159efcb55966;hpb=88b14706dd1d133fe7734f66e9c4980e36d6bc9f;p=fa-stable.git diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index 0fec40a9..115fa929 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -361,7 +361,7 @@ class FrontReport extends Cpdf if ($pdf_debug == 1) { - $pdfcode = $this->Output(); + $pdfcode = $this->Output('','S'); $pdfcode = str_replace("\n", "\n
", htmlspecialchars($pdfcode)); echo ''; echo trim($pdfcode); @@ -377,8 +377,6 @@ class FrontReport extends Cpdf else { - $buf = $this->Output(); - $len = strlen($buf); $dir = $comp_path.'/'.user_company(). '/pdf_files'; //save the file if (!file_exists($dir)) @@ -387,12 +385,8 @@ class FrontReport extends Cpdf } // do not use standard filenames or your sensitive company data // are world readable - $fname = tempnam($dir, 'FA'); - rename($fname, $fname.'.pdf'); - $fname .= '.pdf'; - $fp = fopen($fname,'w'); - fwrite($fp,$buf); - fclose($fp); + $fname = $dir.'/'.uniqid('').'.pdf'; + $this->Output($fname, 'F'); if ($email == 1) { $emailtype = true;