fix(darwin): escape special XML characters in Info.plist template values#5230
fix(darwin): escape special XML characters in Info.plist template values#5230leaanthony wants to merge 1 commit into
Conversation
The plist templates used text/template with raw value interpolation,
so characters like & in wails.json fields (e.g. copyright) produced
invalid XML in the generated Info.plist, breaking macOS packaging.
Add an xmlEscape helper function and use it via the {{xml}} template
func in both Info.plist and Info.dev.plist templates.
Fixes #4865
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
🤖 PR Triage Review ✅ Accepted Escapes special XML characters in Info.plist template values. Prevents XML injection issues. Platform: macOS (v2-only) Next Steps: Dispatching for Mac testing. Reviewed by Wails PR Reviewer Bot |
Summary
xmlEscapetemplate function that uses Go'shtml/templateescaping{{xml .Value}}to all user-facing values inInfo.plistandInfo.dev.plisttemplates&,<,>inwails.jsonfields (e.g. copyright) now produce valid XMLTest
v2/pkg/buildassets/xml_escape_test.go— verifies ampersand, angle bracket, and quote escapingTestResolveProjectDataEscapesAmpersand— end-to-end test with a plist-like templateFixes #4865