Special characters decode breaks page title

Created on 29 April 2025, 5 days ago

Problem/Motivation

The metatag module is modifying the page title when applying htmlentities_decode to the meta values.

See https://git.drupalcode.org/project/metatag/-/blob/2.0.x/src/MetatagManag...

Steps to reproduce

On a vanilla install of D10 with metatag module enabled, create a page with a less than symbol and some text with no space, ie "this is my Save the page and view
With metatag module enabled, the title is truncated from the less than (becomes "this is my")
Leave the node unchanged and disable the metatag module.
The title is now correct.

Proposed resolution

I'm not sure if we need metatag to modify the page title at all. Maybe it could be excluded from the loop processing the values.

Note that this code exists also in 2.1.x; https://git.drupalcode.org/project/metatag/-/blob/2.1.x/src/MetatagManag...

Remaining tasks

Identify solution
Update code

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia cb Sydney

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

Comments & Activities

Production build 0.71.5 2024