ZF-11551: Zend_Filter_StringTrim does not work correctly with input which ends with a unicode char like "à"

Issue Type: Bug Created: 2011-07-12T15:59:55.000+0000 Last Updated: 2011-09-25T09:05:49.000+0000 Status: Resolved Fix version(s): - Next Major Release ()

Reporter: Giuliano Riccio (cosmo87rg) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter

Related issues: - ZF-10891



Zend_Filter_StringTrim will corrupt the last unicode character whose non utf-8 interpretation ends with a whitespace. For example the non utf-8 interpretation of "à" is "Ã "

The code is simple

<pre class="highlight">
$oFilter = new Zend_Filter_StringTrim();


will output:
string(4) "aàa"
string(4) "àaa"
string(3) "aaa"
string(4) "àa�"
string(5) "àà�"
string(1) "�"
string(2) "ò"
string(2) "ù"
string(2) "ì"
string(2) "д"
string(2) "û"

non utf-8 output:
string(4) "aà a"
string(4) "Ã aa"
string(3) "aaa"
string(4) "Ã aÃ"
string(5) "Ã Ã Ã"
string(1) "Ã"
string(2) "ò"
string(2) "ù"
string(2) "ì"
string(2) "д"
string(2) "û"


Posted by Ramon Henrique Ornelas (ramon) on 2011-07-24T07:26:41.000+0000

Duplicates of ZF-11533.

Posted by Thomas Weidner (thomas) on 2011-07-24T20:43:01.000+0000

This issue duplicates ZF-10891

Posted by Thomas Weidner (thomas) on 2011-07-24T20:44:44.000+0000

This issue has been fixed with GH-107

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.