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

Printing as ZIP results in malformed ZIP #49

Open
sevmonster opened this issue Oct 22, 2020 · 3 comments
Open

Printing as ZIP results in malformed ZIP #49

sevmonster opened this issue Oct 22, 2020 · 3 comments

Comments

@sevmonster
Copy link

sevmonster commented Oct 22, 2020

For example, http://osticket/scp/tickets.php?id=1&a=zip results in these warnings:

PHP Warning:  file_get_contents(): Unable to find the wrapper "phar" - did you forget to enable it when you configured PHP? in phar://osticket/include/plugins/attachment_preview.phar/class.AttachmentPreviewPlugin.php on line 169
PHP Warning:  file_get_contents(phar://osticket/include/plugins/attachment_preview.phar/stylesheet.css): failed to open stream: No such file or directory in phar://osticket/include/plugins/attachment_preview.phar/class.AttachmentPreviewPlugin.php on line 169
PHP Warning:  file_get_contents(): Unable to find the wrapper "phar" - did you forget to enable it when you configured PHP? in phar://osticket/include/plugins/attachment_preview.phar/class.AttachmentPreviewPlugin.php on line 186
PHP Warning:  file_get_contents(phar://osticket/include/plugins/attachment_preview.phar/script.js): failed to open stream: No such file or directory in phar://osticket/include/plugins/attachment_preview.phar/class.AttachmentPreviewPlugin.php on line 186

And ignoring those warnings spits out the following malformed ZIP file:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>PK</p><script></script>
</body></html>

I assume the NUL in the ZIP is causing the rest of the file to not display in the <p> tag.

image

@clonemeagain
Copy link
Owner

clonemeagain commented Oct 22, 2020 via email

@sevmonster
Copy link
Author

sevmonster commented Oct 22, 2020

Yes; don't know if you've seen it or when it was added, but this is what the current Print option looks like for a ticket in the SCP:
image
The bottom two choices provide a ZIP file with attachments included.

@crazy-mc
Copy link

Hi are there any updates to this issue? My team love this plugin but every time they have to create a zip i must deactivate it and reactivate when it's done. Next time we want to update to 1.18 but i see there are also problems with compatibility

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

No branches or pull requests

3 participants