ZF-3516: Zend_Filter_HtmlEntities should support htmlentities() fourth argument double_encode

Description

Zend_Filter_HtmlEntities uses htmlentities with 3 arguments, while the function has a 4th argument that determines if already-encoded entities are skipped or not.

Should be used and available to set/get, to enable using the filter on a string that might contain entities.

Comments

I can submit a patch to resolve this issue, but I want to clarify something first. Since the optional 4th argument of htmlentities() was added in PHP 5.2.3 and the minimum ZF version is 5.2.4, do we need to examine the PHP version and react accordingly or can we simply assume support for it? If we do need to test for PHP version, here are the possible scenarios:

1) Only 3 arguments given. No need to test PHP version; call htmlentities() with 3 arguments. 2) All 4 arguments given and PHP >= 5.2.3. Call htmlentities() with 4 arguments. 3) All 4 arguments given and PHP < 5.2.3. Call htmlentities() with 3 arguments and/or throw an exception.

I'm wondering exactly how to handle scenario #3.

NOTE: Current minimum PHP version for ZF taken from this URL: http://framework.zend.com/manual/en/…

Added new feature with r16185