[Drupal] duplicated entry for meta http-equiv=\"Content-Type\" in the head-area

不打扰是莪最后的温柔 提交于 2019-12-23 05:13:03

look in the source of the d.o theme:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

one <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> is definitly enough.

 

That is the problem of D6, you will find this details in

 

 

here is an example to resolve it.

 

In you theme, here is demo theme, template.php file,

function demo_preprocess_page(&$vars, $hook) {
  
//other codes. 
  //Put the code below at the end of this function.


  
$head_old = explode("\n", $vars['head']);
  
$head_new = '';
  
foreach ($head_old as $k=>$v) {
    
if (strpos($v, 'charset=utf-8'=== FALSE) {
      
$head_new .= $v . "\n";
    }
  }
  
$vars['head'= $head_new;


After that, you will resolve this problem.

 

Have fun with Drupal! 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!