From ce0ffd1641d794ad589c1c000762cf94ee6729d0 Mon Sep 17 00:00:00 2001 From: CloudVisionBulgaria <69676022+CloudVisionBulgaria@users.noreply.github.com> Date: Tue, 18 Aug 2020 23:17:25 +0300 Subject: [PATCH] Update YoutubeParser.php --- src/LinkPreview/Parser/YoutubeParser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LinkPreview/Parser/YoutubeParser.php b/src/LinkPreview/Parser/YoutubeParser.php index aaab6bb..08e8786 100644 --- a/src/LinkPreview/Parser/YoutubeParser.php +++ b/src/LinkPreview/Parser/YoutubeParser.php @@ -143,7 +143,7 @@ protected function parseHtml($html) libxml_use_internal_errors(true); $doc = new \DOMDocument(); - $doc->loadHTML($html); + $doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); /** @var \DOMElement $meta */ foreach ($doc->getElementsByTagName('meta') as $meta) { @@ -171,4 +171,4 @@ private function readLink() $reader = $this->getReader()->setLink($this->getLink()); $this->setLink($reader->readLink()); } -} \ No newline at end of file +}