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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2910165-avoid-token-exposal.patch | 3.16 KB | mxh |
Comments
Comment #2
mxh commentedAttaching a quick fix, but it's probably not suitable for everyone.
Comment #3
karens commentedSee the new 8.2 branch, which uses the Schema.org Metatag module. That module uses token handling from the Metatag module.
Comment #4
karens commented