diff --git a/src/Liquid/StandardFilters.php b/src/Liquid/StandardFilters.php index bb02cdf..c3e274d 100644 --- a/src/Liquid/StandardFilters.php +++ b/src/Liquid/StandardFilters.php @@ -202,7 +202,7 @@ public static function escape($input) } if (is_null($input)) { - return $input; + return ''; } return htmlentities($input, ENT_QUOTES); diff --git a/tests/Liquid/StandardFiltersTest.php b/tests/Liquid/StandardFiltersTest.php index 7b51904..701e999 100644 --- a/tests/Liquid/StandardFiltersTest.php +++ b/tests/Liquid/StandardFiltersTest.php @@ -231,7 +231,7 @@ public function testEscape() $data = array( "one Word's not" => "one Word's not", "&><\"'" => "&><"'", - null => null, + null => '', ); foreach ($data as $element => $expected) {