Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#9194 closed defect (bug) (fixed)

HTML emails show HTML anchor tag for Privacy Policy instead of rendering the HTML anchor tag

Reported by: emaralive Owned by: imath
Priority: normal Milestone: 14.0.0
Component: Templates Version: 12.5.1
Severity: normal Keywords: has-screenshots has-patch dev-feedback commit
Cc:

Description

This is a regression introduced in BuddyPress 12.4.1 and applies to both Legacy and Nouveau template packs whereby the Private Policy link is shown as the HTML anchor element instead of being rendered, see screenshot - screenshot-win10-me-2024.06.18-09_08_31.png.

The easiest way to replicate (see) the issue is to:

  • Have a published "Private Policy" page.
  • Go to site.url/wp-admin/edit.php?post_type=bp-email
  • Mouseover any Email template to expose the "visit" link then click visit.

You should see something similar to the aforementioned screenshot.

This issue is with the use of the esc_html() function which converts the < (less than) and > (greater than) characters into their respective HTML entities, e.g., &lt; and &gt;, and can be found on Line 218 of src/bp-templates/bp-nouveau/buddypress/assets/emails/single-bp-email.php and Line 218 of src/bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php.

The patch replaces the esc_html() function with the wp_kses() function and fixes the issue, see screenshot - screenshot-win10-me-2024.06.18-11_26_33.png.

Attachments (3)

screenshot-win10-me-2024.06.18-09_08_31.png (32.1 KB ) - added by emaralive 2 years ago.
screenshot-win10-me-2024.06.18-09_08_31.png
screenshot-win10-me-2024.06.18-11_26_33.png (24.6 KB ) - added by emaralive 2 years ago.
screenshot-win10-me-2024.06.18-11_26_33.png
9194.01.patch (1.8 KB ) - added by emaralive 2 years ago.
Initial patch

Download all attachments as: .zip

Change History (7)

@emaralive
2 years ago

screenshot-win10-me-2024.06.18-09_08_31.png

@emaralive
2 years ago

screenshot-win10-me-2024.06.18-11_26_33.png

@emaralive
2 years ago

Initial patch

#1 @imath
2 years ago

  • Keywords commit added

Hi @emaralive

Thanks a lot for your catch & patch, it looks good to me 👌

#2 @imath
2 years ago

In 13933:

Email template footer: use an escape function allowing to output links

Props emaralive

See #9194 (trunk)

#3 @imath
2 years ago

  • Owner set to imath
  • Resolutionfixed
  • Status newclosed

In 13934:

Email template footer: use an escape function allowing to output links

Props emaralive

Fixes #9194 (branch 12.0)

#4 @imath
2 years ago

  • Milestone 12.6.014.0.0
Note: See TracTickets for help on using tickets.