Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null bytes found in saving the PDF order #1125

Closed
boesbo opened this issue Jul 26, 2020 · 1 comment · Fixed by #1302
Closed

Null bytes found in saving the PDF order #1125

boesbo opened this issue Jul 26, 2020 · 1 comment · Fixed by #1302
Labels

Comments

@boesbo
Copy link
Contributor

boesbo commented Jul 26, 2020

Null bytes are detected if you try to save the pdf Order. The "Varien_Io_File::_IsValidSource($src)" function blocks the upload because it finds null bytes (strpos($src, chr(0)) === false).

Preconditions (*)

v1.9.4.x-dev

Steps to reproduce (*)

// Get pdf.
$pdf = Mage::getModel('emailattachments/order_pdf_order')->getPdf([$order]);
$pdfName = 'order.pdf';
$baseDir = Mage::getBaseDir('tmp');
$filePath = $baseDir . DS . $pdfName;

$file = new Varien_Io_File();
$file->write($filePath, $pdf->render());
@boesbo boesbo added the bug label Jul 26, 2020
@sreichel sreichel added 3rd-party Related to 3rd-party code or issues with customization and removed 3rd-party Related to 3rd-party code or issues with customization labels Jul 26, 2020
@maximehuran
Copy link
Contributor

I have the same problem when I use Image API to create new product image sending the content in base64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants