diff --git a/lib/Cpdf.php b/lib/Cpdf.php index 4df67678a..d47a4b27e 100644 --- a/lib/Cpdf.php +++ b/lib/Cpdf.php @@ -4801,12 +4801,12 @@ protected function addImagePngAlpha($file, $x, $y, $w, $h, $byte) imagesavealpha($img, false); // create temp alpha file - $tempfile_alpha = tempnam($this->tmp, "cpdf_img_"); + $tempfile_alpha = @tempnam($this->tmp, "cpdf_img_"); @unlink($tempfile_alpha); $tempfile_alpha = "$tempfile_alpha.png"; // create temp plain file - $tempfile_plain = tempnam($this->tmp, "cpdf_img_"); + $tempfile_plain = @tempnam($this->tmp, "cpdf_img_"); @unlink($tempfile_plain); $tempfile_plain = "$tempfile_plain.png"; diff --git a/src/Adapter/CPDF.php b/src/Adapter/CPDF.php index 03df164a6..889eb4da2 100644 --- a/src/Adapter/CPDF.php +++ b/src/Adapter/CPDF.php @@ -627,7 +627,7 @@ protected function _convert_gif_bmp_to_png($image_url, $type) imageinterlace($im, false); $tmp_dir = $this->_dompdf->getOptions()->getTempDir(); - $tmp_name = tempnam($tmp_dir, "{$type}dompdf_img_"); + $tmp_name = @tempnam($tmp_dir, "{$type}dompdf_img_"); @unlink($tmp_name); $filename = "$tmp_name.png"; $this->_image_cache[] = $filename; diff --git a/src/Adapter/PDFLib.php b/src/Adapter/PDFLib.php index 42d079f8c..b07e91b1f 100644 --- a/src/Adapter/PDFLib.php +++ b/src/Adapter/PDFLib.php @@ -208,7 +208,7 @@ public function __construct($paper = "letter", $orientation = "portrait", Dompdf $this->_pdf->begin_document("", ""); } else { $tmp_dir = $this->_dompdf->getOptions()->getTempDir(); - $tmp_name = tempnam($tmp_dir, "libdompdf_pdf_"); + $tmp_name = @tempnam($tmp_dir, "libdompdf_pdf_"); @unlink($tmp_name); $this->_file = "$tmp_name.pdf"; $this->_pdf->begin_document($this->_file, ""); diff --git a/src/FontMetrics.php b/src/FontMetrics.php index be835f04b..0266e589e 100644 --- a/src/FontMetrics.php +++ b/src/FontMetrics.php @@ -186,7 +186,7 @@ public function registerFont($style, $remoteFile, $context = null) $fontDir = $this->getOptions()->getFontDir(); $remoteHash = md5($remoteFile); $localFile = $fontDir . DIRECTORY_SEPARATOR . $remoteHash; - $localTempFile = tempnam($this->options->get("tempDir"), "dompdf-font-"); + $localTempFile = @tempnam($this->options->get("tempDir"), "dompdf-font-"); $cacheEntry = $localFile; $localFile .= ".".strtolower(pathinfo(parse_url($remoteFile, PHP_URL_PATH),PATHINFO_EXTENSION)); diff --git a/src/Image/Cache.php b/src/Image/Cache.php index 8d073c22a..479d2e679 100644 --- a/src/Image/Cache.php +++ b/src/Image/Cache.php @@ -88,7 +88,7 @@ static function resolve_url($url, $protocol, $host, $base_path, Dompdf $dompdf) } // From remote else { $tmp_dir = $dompdf->getOptions()->getTempDir(); - $resolved_url = tempnam($tmp_dir, "ca_dompdf_img_"); + $resolved_url = @tempnam($tmp_dir, "ca_dompdf_img_"); $image = ""; if ($data_uri) { diff --git a/src/Renderer/AbstractRenderer.php b/src/Renderer/AbstractRenderer.php index 9a3df2f84..502e78a02 100644 --- a/src/Renderer/AbstractRenderer.php +++ b/src/Renderer/AbstractRenderer.php @@ -401,7 +401,7 @@ protected function _background_image($url, $x, $y, $width, $height, $style) $this->_canvas->get_cpdf()->addImagePng($filedummy, $x, $this->_canvas->get_height() - $y - $height, $width, $height, $bg); } else { $tmp_dir = $this->_dompdf->getOptions()->getTempDir(); - $tmp_name = tempnam($tmp_dir, "bg_dompdf_img_"); + $tmp_name = @tempnam($tmp_dir, "bg_dompdf_img_"); @unlink($tmp_name); $tmp_file = "$tmp_name.png";