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

Issue Type: Improvement Created: 2008-06-26T07:02:30.000+0000 Last Updated: 2009-06-20T06:35:15.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Oren Sol (stanzapub) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter

Related issues: Attachments:


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.


Posted by Patrick Lee (patrick) on 2009-04-07T13:06:56.000+0000

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:…

Posted by Thomas Weidner (thomas) on 2009-06-20T06:35:10.000+0000

Added new feature with r16185

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.