Adds compatibility for Ghostscript >=9.50.0 #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is so useful and still works with WP 5.6. However I had difficulties on a server with Ubuntu and Ghostscript 9.50.0. Just received the error
Failed to generate the PDF preview.
. Some debugging showed that the issue comes from Ghostscript and some reasearch clarified that since GhostScript 9.50 the SAFER mode has been turned ON by default, resulting in/invalidfileaccess
errors.This PR adds the WP upload path to the permitted reading list to solve
/invalidfileaccess
errors. However there would bee another solution to pass the sorce PDF path via--permit-file-read=
but that requires some more changes in the plugin. So this is more a quick solution as the best solution.See more: https://stackoverflow.com/a/61310729/1456459