use multibyte-aware mb_strlen() instead of strlen(); fixed issue #8)
This commit is contained in:
@@ -72,7 +72,7 @@ function twig_sprintf_filter( $value, $var) {
|
||||
}
|
||||
|
||||
function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') {
|
||||
if (strlen($value) > $length) {
|
||||
if (mb_strlen($value) > $length) {
|
||||
if ($preserve) {
|
||||
if (false !== ($breakpoint = strpos($value, ' ', $length))) {
|
||||
$length = $breakpoint;
|
||||
|
@@ -7,7 +7,8 @@
|
||||
|
||||
require 'contrib/gettext/gettext.inc';
|
||||
|
||||
register_shutdown_function('fatal_error_handler');
|
||||
register_shutdown_function('fatal_error_handler');
|
||||
mb_internal_encoding('UTF-8');
|
||||
loadConfig();
|
||||
|
||||
function loadConfig() {
|
||||
|
Reference in New Issue
Block a user