Add dirty workaround for old libxml on Debian Lenny

This commit is contained in:
Frederic Guillot 2013-05-21 16:01:10 +02:00
parent 425745ad9a
commit 9f896babe5

View File

@ -114,8 +114,11 @@ class Filter
// Convert bad formatted documents to XML // Convert bad formatted documents to XML
$dom = new \DOMDocument; $dom = new \DOMDocument;
$dom->loadHTML('<?xml encoding="UTF-8">'.$data); $dom->loadHTML('<?xml version="1.0" encoding="UTF-8">'.$data);
$this->input = $dom->saveXML($dom->getElementsByTagName('body')->item(0)); $this->input = $dom->saveXML($dom->getElementsByTagName('body')->item(0));
// Workaround for old libxml2 (Debian Lenny)
if (LIBXML_DOTTED_VERSION === '2.6.32') $this->input = utf8_decode($this->input);
} }