Download & Extend

Meta tags content is not correctly encoded/filtered

Project:Nodewords: D6 Meta Tags
Version:6.x-1.x-dev
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Using in conjunction with other modules I noticed that nodewords is not stripping certain tags and not displaying content correctly in the head element of some nodes.

The output on page in the html appears as <meta name="description" content="&lt;p&gt;Details are here&lt;/p&gt;" />

For further info: http://drupal.org/node/587016

Comments

#1

Title:Nodewords module is double encoding ('s) and not stripping tags» Meta tags content is not correctly encoded/filtered
Version:6.x-1.2» 6.x-1.x-dev
Priority:critical» normal

I marked #587094: HTML entities cannot be used in the meta tags content as duplicate of this report.

#2

Status:active» needs review

Very simple, contents are already escaped, then it gets double encoded with a call to check_plain()

AttachmentSizeStatusTest resultOperations
nodewords-587248.patch933 bytesIgnored: Check issue status.NoneNone

#3

Is that the only change that needs to be done to the code?

#4

not quite...
http://php.net/html-entity-decode#93378

this patch works

AttachmentSizeStatusTest resultOperations
nodewords-587248.1.patch954 bytesIgnored: Check issue status.NoneNone

#5

+

#6

Status:needs review» fixed

The code has been changed, and committed in CVS.

Thanks for the report, and the patch.

#7

Status:fixed» needs work

Rather than using html_entity_decode(), the code should use decode_entities(); it should also strip any HTML tags, which should not be present on the output meta tags.

#8

Status:needs work» fixed

I changed the code as reported in the previous comment, and committed the code in CVS.

#9

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#10

i'm using nodewords version 6x-1.11 and the problem still exist. when i key in description, for e.g., What's new, it show in the html source code as What&#039;s new

i tried with the patch but not working.

[Edited by kiamlaluno to show the encoded entities]

#11

@xsean: That is perfectly normal. Entities are allowed in the meta tags content, and browsers should be prepared to handle them; this is what W3.org reports (to note that content is defined as CDATA).

nobody click here