Skip to content

Decodes HTML entities in quote and mention email subjects - #9911

Open
boredskull wants to merge 1 commit into
SimpleMachines:release-3.0from
boredskull:fix-7583-email-subject-entities
Open

boredskull wants to merge 1 commit into
SimpleMachines:release-3.0from
boredskull:fix-7583-email-subject-entities

Conversation

@boredskull

Copy link
Copy Markdown

Summary

Fixes #7583.

This PR fixes HTML entities appearing in email notifications when topic titles contain quotation marks or other HTML-sensitive characters.

Currently, quote and mention notification emails can display HTML-escaped characters instead of their original values.

Example

Before:

You have been quoted in the post titled "Re: foo "bar""

After:

You have been quoted in the post titled "Re: foo "bar""

Changes

Updated Sources/Tasks/CreatePost_Notify.php to decode HTML entities when populating the CONTENTSUBJECT email template replacement.

  • Applies the existing Utils::htmlspecialcharsDecode() utility.
  • Fixes both quote and mention notification email subjects.
  • Does not modify stored topic titles or forum alerts.
  • Introduces no new dependencies or configuration options.

Technical details

Previously:

'CONTENTSUBJECT' => $msgOptions['subject'],

Now:

'CONTENTSUBJECT' => Utils::htmlspecialcharsDecode($msgOptions['subject']),

The change follows the existing HTML entity decoding approach already used elsewhere in SMF's notification handling.

Testing

  • Verified the affected notification handlers.
  • Reviewed the diff to ensure only the intended replacements changed.
  • Test quote notifications containing HTML-sensitive characters.
  • Test mention notifications containing HTML-sensitive characters.
  • Verify plain-text and HTML email formatting.
  • Confirm there are no regressions with ordinary topic titles.

Note: Runtime email tests have not yet been performed.

Compatibility

Targeted at SMF 3.0 (release-3.0).

No database changes, language changes or additional configuration are required.

Closes #7583.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML-escaped quotes in topic titles in mail

1 participant