Skip to content
Permalink
Browse files

ignored only utf

  • Loading branch information...
oscarotero committed May 24, 2019
1 parent 56d5a6c commit a20d711d573db750a1a65a5ff61947749183c49e
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/Http/Response.php
@@ -61,7 +61,8 @@ public function getHtmlContent()
$entities = libxml_disable_entity_loader(true);
$this->htmlContent = new DOMDocument();
if (stripos($content, '<meta charset=') === false) {
if (stripos($content, '<meta charset="utf') === false) {
$encodings = [
'ASCII' => 'ascii',
'UTF-8' => 'utf-8',
@@ -86,7 +87,7 @@ public function getHtmlContent()
];
$detected = mb_detect_encoding($content, implode(',', array_keys($encodings)), true);
if ($detected && !empty($encodings[$detected])) {
$content = mb_convert_encoding($content, 'HTML-ENTITIES', $detected);
$content = preg_replace(

0 comments on commit a20d711

Please sign in to comment.
You can’t perform that action at this time.