Closed (outdated)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2019 at 21:39 UTC
Updated:
29 Sep 2026 at 20:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
drummThis happens with metatag_opengraph, and even the title tag itself, on a clean install. A node with title “Test < one <two” becomes “Test < one” for both the
head_titletitle tag, andog:title. Notice that a space after the < does not trigger removal, only < immediately followed by a character.(www.drupal.org does not have the
<title>symptom on issues because project_issue module overrideshead_title, https://cgit.drupalcode.org/project_issue/tree/project_issue.module#n1458)In
DrupalDefaultMetaTag::tidyValue(), if I comment outthis is worked around, but that would have side effects.
#3030181: Filter JavaScript, style content out of values before they're output is a recent issue in the same function, it might help show the types of tests to write. A regexp-based replacement to
strip_tags()would be potentially effective and likely messy.Comment #3
drummComment #4
vijaycs85Thanks, @drumm for further investigation and moving to this module. Here is the test to prove this issue. As it's a test-only patch, expect to fail.
Comment #6
damienmckennaComment #7
damienmckennaDoes simply removing the strip_tags() call fix this?
Comment #9
damienmckennaSo the short answer is: yes.
The longer answer is: we need to make sure that HTML can't leak through unwanted to accidentally close the META tags and let other output show up on the page.
Comment #10
damienmckennaAnother issue is that strip_tags() currently removes the standard HTMl that can be added to the output of field tokens, I'm not sure it's possible to distinguish between wrapper HTML on field output and the field values.
This is where it starts getting complicated.
Comment #11
damienmckennaComment #12
bluegeek9 commented