zoukankan      html  css  js  c++  java
  • [Drupal] duplicated entry for meta httpequiv="ContentType" in the headarea

    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! 

  • 相关阅读:
    向内的寻找
    了解潜意识
    NOI2014 Day1
    NOI2011 Day1
    NOI2012 Day2
    NOI2012 Day1
    NOI2013 Day2
    NOI2013 Day1
    拉格朗日乘数法
    NOI2015 Day2
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/2000806.html
Copyright © 2011-2022 走看看