ZF-11809: Wrong handling of ending spaces in Zend_Text_MultiByte::wordWrap()


If you give the static method Zend_Text_MultiByte::wordWrap a string that has the same length as the maximum length for a line plus an ending space and set the cut parameter to true, the ending space will be added to the first line and no second line is created.

For example

$text = 'aloha ';
echo Zend_Text_MultiByte::wordWrap($text, 5, '-', true);

returns 'aloha ' but should return 'aloha-'


Added Bugfix and unittest