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

avpaderno’s picture

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
mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new933 bytes

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

avpaderno’s picture

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

mikeytown2’s picture

StatusFileSize
new954 bytes

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

this patch works

hass’s picture

+

avpaderno’s picture

Status: Needs review » Fixed

The code has been changed, and committed in CVS.

Thanks for the report, and the patch.

avpaderno’s picture

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.

avpaderno’s picture

Status: Needs work » Fixed

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

Status: Fixed » Closed (fixed)

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

xsean’s picture

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]

avpaderno’s picture

@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).