BUG FIX: error messages suppressed as a temporary fix

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88752 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2009-10-13 00:35:58 +00:00
parent b59507414f
commit 64612f2070

View File

@ -45,10 +45,17 @@ class SS_HTMLValue extends ViewableData {
* @return bool
*/
public function setContent($content) {
return $this->getDocument()->loadHTML(
'<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head>' .
"<body>$content</body></html>"
);
//This is a patch to prevent invalid HTML returning warnings.
//Error messages are disabled, and then re-enabled
$old_level=error_reporting();
error_reporting(0);
$value=$this->getDocument()->loadHTML(
'<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head>' .
"<body>$content</body></html>");
error_reporting($old_level);
return $value;
}
/**