Replace htmlentities and html_entity_decode with api_... - ref #6933