Fix htmlentites parameters to compatible with all PHP versions

Last change broke backwards compatibility with PHP versions pre-5.4.0