fabpot/Twig-extensions — pull request #49 by jcrombez (2012-03-16 14:17:47+00:00)
Title: Wordwrap : wrong behavior when preserving

If "mb_get_info" exist, there is a special "twig_wordwrap_filter" function not using the php default php wordwrap function. I don't know why it has been done this way, i guess using multibyte string is faster or better regarding encoding support than with the default php wordwrap function.

Anyway, the behavior of this custom function is wrong when $preserve = true, the string is simply the same before and after the filter is applied to it. Also, correct me if i'm wrong but, mb_split use $separator as its separator, the separator used in wordwrap is only supposed to be what is inserted at the end of each new string segments, not what is used to split.

My pull request is trivial and i imagine it won't be the kind of fix you want for this, but i at least wanted to point out this problem.