Skip to:
Content

BuddyPress.org

Opened 17 months ago

Closed 17 months ago

Last modified 16 months 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's profile emaralive Owned by: imath's profile imath
Milestone: 14.0.0 Priority: normal
Severity: normal Version: 12.5.1
Component: Templates 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 17 months 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 17 months ago.
screenshot-win10-me-2024.06.18-11_26_33.png
9194.01.patch (1.8 KB) - added by emaralive 17 months ago.
Initial patch

Download all attachments as: .zip

Change History (7)

@emaralive
17 months ago

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

@emaralive
17 months ago

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

@emaralive
17 months ago

Initial patch

#1 @imath
17 months ago

  • Keywords commit added

Hi @emaralive

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

#2 @imath
17 months ago

In 13933:

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

Props emaralive

See #9194 (trunk)

#3 @imath
17 months ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 13934:

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

Props emaralive

Fixes #9194 (branch 12.0)

#4 @imath
16 months ago

  • Milestone changed from 12.6.0 to 14.0.0
Note: See TracTickets for help on using tickets.