ZF-9854: Encoding problems in the Zend_Filter_StringToLower

Issue Type: Improvement Created: 2010-05-18T07:13:55.000+0000 Last Updated: 2010-08-03T12:19:18.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: Andrei Kulik (agk) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter

Related issues: Attachments: - ZF-9854.patch


If UTF-8 or other multibyte encoding used as default, for example set with mb_internal_encoding or config file, and encoding not specified explicitly then Zend_Filter_StringToLower works incorrectly. It uses strtolower instead of mb_strtolower:

public function filter($value) { if ($this->_encoding !== null) { return mb_strtolower((string) $value, $this->_encoding); }

    return strtolower((string) $value);

The same behaviour in some other filter functions.

It fires then used filter-validators chains. filter (strtolower) destroys multibyte string and when this value passed to a validator, StringLength for example, it lead to error like this: iconv_strlen() [function.iconv-strlen]: Detected an incomplete multibyte character in input string

short workaround: always explicitly set encoding option for each filter instance.


Posted by Ramon Henrique Ornelas (ramon) on 2010-07-25T06:23:12.000+0000

Attached patch.

Posted by Ramon Henrique Ornelas (ramon) on 2010-07-25T07:02:52.000+0000

Reassigned component

Posted by Thomas Weidner (thomas) on 2010-08-03T12:05:23.000+0000

This feature is not supported for now and therefor no bug. Changed from bug to improvement.

Posted by Thomas Weidner (thomas) on 2010-08-03T12:19:18.000+0000

Implemented with r22790 Thank you for the patch

Have you found an issue?

See the Overview section for more details.


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

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