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

(dev/core#4137) Tokens - Filters should be HTML-sensitive #25727

Merged
merged 3 commits into from
Mar 3, 2023

Conversation

totten
Copy link
Member

@totten totten commented Mar 3, 2023

Overview

https://lab.civicrm.org/dev/core/-/issues/4137 presents two issues. This addresses the second issue, wherein the filters {foo.bar|upper} and {foo.bar|lower} may produce distorted output when handling HTML data.

Before

{foo.bar|upper} is strictly treated as plain-text.

If the value of foo.bar is markup , then tags and entities will be capitalized incorrectly.

"this & that"` => "THIS & THAT"`

After

{foo.bar|upper} is evaluated in a template-sensitive way (as plain text or HTML).

If the value of foo.bar is markup, then the textual data will be filtered -- but the tags and entities will be preserve their original values.

"this & that"` => "THIS & THAT"`

@civibot civibot bot added the master label Mar 3, 2023
@civibot
Copy link

civibot bot commented Mar 3, 2023

(Standard links)

@eileenmcnaughton
Copy link
Contributor

Reporter commented on gitlab

image

@eileenmcnaughton eileenmcnaughton merged commit 1f5f8b8 into civicrm:master Mar 3, 2023
namespace Civi\Token;

/**
* This class is a collection of CiviMail filter functions. For example, consider this message:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opps - I just noticed the comment incorrectly references CiviMail - which is just one consumer of tokens

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK @totten I put up a PR to fix it #25730

@totten totten deleted the master-token-case branch March 3, 2023 23:27
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.

2 participants