diff --git a/integration/HTMLValue.php b/integration/HTMLValue.php index ba9580fc3..ee38a6535 100755 --- a/integration/HTMLValue.php +++ b/integration/HTMLValue.php @@ -45,17 +45,10 @@ class SS_HTMLValue extends ViewableData { * @return bool */ public function setContent($content) { - //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( - '
' . - "$content"); - error_reporting($old_level); - return $value; - - + return @$this->getDocument()->loadHTML( + '' . + "$content" + ); } /** @@ -82,4 +75,4 @@ class SS_HTMLValue extends ViewableData { return $this->getContent(); } -} \ No newline at end of file +} diff --git a/tests/integration/HTMLValueTest.php b/tests/integration/HTMLValueTest.php new file mode 100755 index 000000000..4a69b78bc --- /dev/null +++ b/tests/integration/HTMLValueTest.php @@ -0,0 +1,41 @@ +Enclosed Value' => 'Enclosed Value
', + '' => '', + '