Indefero

Indefero Commit Details


Date:2012-02-23 18:29:25 (12 years 9 months ago)
Author:Thomas Keller
Branch:develop, release-1.3
Commit:9bd59128842a3a873c957044d3030a2f5c111338
Parents: c0506c460dc90b766197983644083675129c9874
Message:Fix issue 785.

Changes:

File differences

NEWS.mdtext
44
55
66
7
8
9
710
811
912
## Bugfixes
- Ensure that IDF does not break UTF-8 encoded strings when
shortening them for view rendering (issue 785)
## Documentation
## Translations
src/IDF/Views/Source.php
506506
507507
508508
509
509
510510
511511
512512
513513
514514
515
516
515
516
517517
function IDF_Views_Source_ShortenString($string, $length)
{
$ellipse = "...";
$length = max(strlen($ellipse) + 2, $length);
$length = max(mb_strlen($ellipse) + 2, $length);
$preflen = ceil($length / 10);
if (mb_strlen($string) < $length)
return $string;
return substr($string, 0, $preflen).$ellipse.
substr($string, -($length - $preflen - mb_strlen($ellipse)));
return mb_substr($string, 0, $preflen).$ellipse.
mb_substr($string, -($length - $preflen - mb_strlen($ellipse)));
}

Archive Download the corresponding diff file

Page rendered in 0.08291s using 14 queries.