Menu

#129 incorrect detection page charset by meta-tag "Content-Type"

closed
nobody
None
2018-12-06
2013-07-12
No

Incorrect detection page charset by meta-tag "Content-Type":

For example:
1) correct detection

<meta http-equiv="Content-Type" content="text/html;charset=windows-1251">

2) incorrect detection,

<meta http-equiv="content-type" content="text/html;charset=windows-1251">

It's happens in simple_html_dom.php, ~1207 line:

$el = $this->root->find('meta[http-equiv=Content-Type]',0);

The selector 'meta[http-equiv=Content-Type]' case-sensitive and works only for http-equiv="Content-Type", not for http-equiv="content-type"

Discussion

  • hlcb

    hlcb - 2014-05-28

    $el = $this->root->find('meta[http-equiv=Content-Type]',0); // Old

    $el = $this->root->find('meta[http-equiv=Content-Type]',0,true); //New

     
  • John Schlick

    John Schlick - 2014-05-28

    Just uploaded the version with the ",true" added to it.

    Thanks for finding it, and letting me know.

     
  • John Schlick

    John Schlick - 2014-05-28
    • status: open --> closed
     

Log in to post a comment.