Problem

When using tokens which can't be resolved due to falsely assumed data strucutures or simply non-existent field values, the output of the token replacing contains the used token itself. Example:

Using token for author: [node:my_author_field:title]

Author reference is not there, so the output of $token->replace is simply the same, leading to engines and bots using this value.

Proposed solution

A little bit tricky, since one also might want to be able to have non-token text for the metadata value config. It's probably also not a specific problem of the AMP-module, but of the core token system.

---
Marking as major since token structures should never be exposed, especially not for search engines or other external services / platforms.

CommentFileSizeAuthor
#2 2910165-avoid-token-exposal.patch3.16 KBmxh

Comments

mxh created an issue. See original summary.

mxh’s picture

Status: Active » Needs review
StatusFileSize
new3.16 KB

Attaching a quick fix, but it's probably not suitable for everyone.

karens’s picture

Status: Needs review » Fixed

See the new 8.2 branch, which uses the Schema.org Metatag module. That module uses token handling from the Metatag module.

karens’s picture

Status: Fixed » Closed (won't fix)