diff --git a/lib/Cake/Test/Case/BasicsTest.php b/lib/Cake/Test/Case/BasicsTest.php index 4dcff7d3d..2bcce4549 100644 --- a/lib/Cake/Test/Case/BasicsTest.php +++ b/lib/Cake/Test/Case/BasicsTest.php @@ -243,6 +243,9 @@ class BasicsTest extends CakeTestCase { $obj = new CakeResponse(array('body' => 'Body content')); $result = h($obj); $this->assertEquals('Body content', $result); + + $result = h(null); + $this->assertEquals('', $result); } /** diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index 0e9f13956..3b9417ed8 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -215,6 +215,8 @@ if (!function_exists('h')) { } } elseif (is_bool($text)) { return $text; + } elseif (is_null($text)) { + return ''; } static $defaultCharset = false;