Tokens are HTML encoded

Created on 24 October 2024, about 2 months ago

Problem/Motivation

In a token pattern setting, tokens are replaced as markup, not plain text, by using this line of code :

```PHP
$return_value = $this->getTokenService()->replace($value, $token_data, ['clear' => TRUE]);
```
(in the `settingsPreprocess()` method of `src/Plugin/TokenSettingTypeBase.php` file)

for instance, in our case the URL produced by the custom token is an URL containing query parameters. So `/some-url?foo=aaa&bar=bbb` is rendered as `/some-url?foo=aaa&bar=bbb`, creating a wrong link.

Steps to reproduce

Create a token that generates aan URL with query parameters and use it.

Proposed resolution

See incomming patch (working on it).

🐛 Bug report
Status

Active

Version

2.4

Component

Code

Created by

🇫🇷France NicociN

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024