Skip to content

Replace "echo <script>..." by Html::scriptBlock() instructions - #26318

Merged
AdrienClairembault merged 1 commit into
glpi-project:mainfrom
AdrienClairembault:migrate-echo-scripts
Nov 13, 2026
Merged

AdrienClairembault merged 1 commit into
glpi-project:mainfrom
AdrienClairembault:migrate-echo-scripts

Conversation

@AdrienClairembault

Copy link
Copy Markdown
Member

Extracted from #26020 for easier review.

CSP require us to add a "nonce" property to every script tags.

The nonce will be added inside Html::scriptBlock() / Html::script() so we must make sure every "echo-ed" script tag is generated by that method.

@AdrienClairembault

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Powered by Qodo

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Refactor
    • Updated script rendering across forms, installation and update pages, validation views, API documentation, the marketplace, reservations, and rule lists.
    • Existing page behavior and displayed content remain unchanged.

The changes replace manually assembled script elements with Html::scriptBlock() or Html::script() across forms, views, controllers, and installation pages. Module and import-map script types are specified through ScriptType. The supplied summaries report no changes to the existing JavaScript behavior.

Suggested reviewers: cedric-anne, trasher

Merge Risk: Minimal · up to 1de05

This change moves script output to a shared helper so a CSP nonce can be added later. No behavior regression has been identified, so it is ready to merge after normal checks.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@AdrienClairembault
AdrienClairembault merged commit 6ac7a85 into glpi-project:main Nov 13, 2026
15 checks passed
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

Successfully merging this pull request may close these issues.

2 participants