MINOR CSSContentParser::__construct() now gives a better error if the content could not be parsed. This will mostly happen if tidy isn't present.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@109274 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-08-12 02:50:26 +00:00 committed by Sam Minnee
parent 4311966880
commit c86d297b0d

View File

@ -46,7 +46,10 @@ class CSSContentParser extends Object {
$tidy = $content;
}
$this->simpleXML = simplexml_load_string($tidy, 'SimpleXMLElement', LIBXML_NOWARNING);
$this->simpleXML = @simplexml_load_string($tidy, 'SimpleXMLElement', LIBXML_NOWARNING);
if(!$this->simpleXML) {
throw new Exception('CSSContentParser::__construct(): Could not parse content. Please check the PHP extension tidy is installed.');
}
parent::__construct();
}