BUGFIX CSSContentParser now reports better errors by using simplexml_load_string() instead of SimpleXMLElement directly (from r103552)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112147 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-13 03:57:07 +00:00
parent 077a119cfb
commit 35378e577e

View File

@ -34,6 +34,7 @@ class CSSContentParser extends Object {
$tidy->cleanRepair();
$tidy = str_replace('xmlns="http://www.w3.org/1999/xhtml"','',$tidy);
$tidy = str_replace(' ','',$tidy);
} elseif(@shell_exec('which tidy')) {
// using tiny through cli
$CLI_content = escapeshellarg($content);
@ -45,7 +46,7 @@ class CSSContentParser extends Object {
$tidy = $content;
}
$this->simpleXML = new SimpleXMLElement($tidy);
$this->simpleXML = simplexml_load_string($tidy, 'SimpleXMLElement', LIBXML_NOWARNING);
parent::__construct();
}