Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
benface authored and bsweeney committed Nov 11, 2018
1 parent efeca91 commit f312c98
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/Cpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/CPDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/PDFLib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
Expand Down
2 changes: 1 addition & 1 deletion src/FontMetrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/Image/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Renderer/AbstractRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit f312c98

Please sign in to comment.