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

🐛 [#4978] Fix accidental HTML escaping in summary PDF/confirmatio… #4987

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

sergei-maertens
Copy link
Member

…n email

While the component/formatter properly takes care of conditional escaping by leveraging format_html and friends, the post-processor was converting the SafeString into a regular string again by doing string-interpolation for the file names, which leads to the full result being HTML escaped again.

In HTML mode, the prefix 'attachment' is now dropped, as the markup and context of the label/field should provide sufficient information and the 'attachment:' prefix looks odd in combination with the

    markup.

    Closes #4978 (partially)

    Changes

    Fixed accidental double HTML escaping of file component markup.

    Checklist

    Check off the items that are completed or not relevant.

    • Impact on features

      • Checked copying a form
      • Checked import/export of a form
      • Config checks in the configuration overview admin page
      • Problem detection in the admin email digest is handled
    • Release management

      • I have labelled the PR as "needs-backport" accordingly
    • I have updated the translations assets (you do NOT need to provide translations)

      • Ran ./bin/makemessages_js.sh
      • Ran ./bin/compilemessages_js.sh
    • Dockerfile/scripts

      • Updated the Dockerfile with the necessary scripts from the ./bin folder
    • Commit hygiene

      • Commit messages refer to the relevant Github issue
      • Commit messages explain the "why" of change, not the how

While the component/formatter properly takes care of conditional
escaping by leveraging format_html and friends, the post-processor
was converting the SafeString into a regular string again by doing
string-interpolation for the file names, which leads to the full
result being HTML escaped again.

In HTML mode, the prefix 'attachment' is now dropped, as the markup and
context of the label/field should provide sufficient information and
the 'attachment:' prefix looks odd in combination with the <ul> markup.
@sergei-maertens sergei-maertens requested a review from vaszig January 6, 2025 14:33
@sergei-maertens
Copy link
Member Author

What it looks like with the patch:

image

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.66%. Comparing base (7f8fd3b) to head (f36da6f).
Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4987   +/-   ##
=======================================
  Coverage   96.66%   96.66%           
=======================================
  Files         761      761           
  Lines       25957    25959    +2     
  Branches     3393     3394    +1     
=======================================
+ Hits        25092    25094    +2     
  Misses        601      601           
  Partials      264      264           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sergei-maertens sergei-maertens merged commit 933bc44 into master Jan 6, 2025
32 checks passed
@sergei-maertens sergei-maertens deleted the issue/4978-fix-escaped-html-in-pdf branch January 6, 2025 16:11
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.

Open Forms 3.0 test plan
2 participants