Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Make the PDF plugin compatible with the Content Security Policy sent by GLPI.
The "Check all" and "Uncheck all" buttons of the PDF export form relied on inline
onclickhandlers, which the browser refuses to run under the CSP.They are now bound from the form's script with jQuery click listeners, calling the same functions with the same arguments.
The plugin declares
csp_compliantinsetup.php.Converted patterns
templates/preference_form.html.twig: twoonclickattributes (handler attributes written directly) replaced by the idsselect_all_{{ form_id }}andselect_none_{{ form_id }}, with listeners added in the existing$(document).readyblock.setup.php:'csp_compliant' => trueadded toplugin_version_pdf().CHANGELOG.md: entry under UNRELEASED.Checked and left unchanged:
<script>blocks intemplates/config.html.twigandtemplates/preference_form.html.twigare literal Twig text, so the nonce is added at compile time;on_change, nojavascript:URL, noHtml::addConfirmationOnAction()orconfirmaction;inc/simplepdf.class.phponly strips<script>tags from user content withpreg_replace, it prints none.Blocked by
PLUGIN_PDF_MIN_GLPI) must be raised to the first CSP-enabled release before merging. This PR keeps 11.0.0.Manual test checklist
Checklist before requesting a review