ZF-6009: Zend_Text_MultiByte::wordWrap() incorrect work

Issue Type: Bug Created: 2009-03-11T18:40:52.000+0000 Last Updated: 2009-03-12T06:50:02.000+0000 Status: Resolved Fix version(s): - 1.7.7 (16/Mar/09)

Reporter: Alexander (halcyon) Assignee: Ben Scholzen (dasprid) Tags: - Zend_Text_Table

Related issues: Attachments:


When you try to do something like this:

$line = Zend_Text_MultiByte::wordWrap('abcdef', 2, ' ', true, 'utf-8');

you'll get "ab cd cdef". But expected result is "ab cd ef".


Posted by Alexander (halcyon) on 2009-03-11T18:48:43.000+0000

The problem actually is in line 62 of Zend/Text/MultiByte.php:

$line = substr($string, strlen($matches[0]));

$string is the first parameter for the method wordWrap(). In cycle this code always cuts part from input string, but not from actual value. It should be:

$line = substr($line, strlen($matches[0]));

Posted by Ben Scholzen (dasprid) on 2009-03-12T06:49:50.000+0000

  • Fixed in r14283-14284 and merged into 1.7 release branch with r14285.
  • Required a complete rewrite of the method
  • Missing unit tests added

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.