Hello,
I am seeing this in both 1.2 and dev snapshot:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Site title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 601264_duplicate_utf8_charset.patch | 816 bytes | matason |
Comments
Comment #1
avpadernoI see it too, but that is not caused by Nodewords. That meta tag is supposed to be returned from
drupal_get_html_head(), but it seems some module is adding it throughdrupal_set_html_head().If it is perfectly legitimate to add such meta tag through
drupal_set_html_head(), why isdrupal_get_html_head()adding it to the output it returns? It should at least check if the meta tag has been already added, at least; differently, it is going to return a duplicated meta tag, as it is happening.Comment #2
avpadernoTo notice that the problem is also present in Drupal.org, which is not using Nodewords.
For this page, I get the following HTML output:
Comment #3
avpadernoI created a report for Drupal (see #601376: Duplicated "Content-type" tag is present in each pages).
I have already noted that when I was testing Nodewords, and I forgot to make a report. Thanks for reminding me of this.
Comment #4
giorgio79 commentedLol , thanks Kiam. :) I have not noticed even drupal.org has this :)
Comment #5
avpadernoI am correcting the title, as the meta tag that appears twice is the one.
Comment #6
avpadernoAlthough the problem is not caused by Nodewords, I added the code to remove any duplicated meta it finds.
Maybe I will add an option to enable that code, and a checking on the Drupal version (in the case the problem is fixed in Drupal core).
Comment #7
hass commentedPut this hereby on my testing list for the reason that this may re-introducing a core security bug.
Comment #8
avpadernoIt's rather impossible, as the code remove duplicated meta , which means there is always that meta tag. The change made on core module is to be sure there is always that meta tag, and the module is not removing all the occurrences of the meta tag.
Comment #9
matason commentedThis duplication is caused by code in common.inc, the charset is added in the function drupal_get_html_head() and then it's inserted again (rather inefficiently) to make sure it's the first thing in head in the function drupal_final_markup()
I've attached a patch which adds to the inefficiency(!) but deals with the duplication. This is not really the place to be doing this, it's too late in the page build process, I'll have a more detailed look this evening and see if there's a better solution.
I've also had a quick look at Drupal 7 and it looks like drupal_final_markup() has gone.
This is also a pretty minor issue(?) that doesn't merit fixing? Does having duplicate charset meta cause any issues?
Comment #10
hass commented#451304: Drupal outputs two meta content-type tags, #19
Comment #11
matason commentedDoh, I should have done a bit of clicking...
This looks like the issue - http://drupal.org/node/451304
Marking this as duplicate.
Comment #12
hass commentedPlease keep the issue as is.
Comment #13
avpadernoI removed the code I added, as the call to
drupal_final_markup()is made after the call tonodewords_preprocess_page(); therefore, the code is perfectly useless.I am changing back the category.