From 8f762ae6d74d1a791b5ea8b3062e8d7e22ed4c84 Mon Sep 17 00:00:00 2001 From: Sascha Greuel Date: Thu, 10 Oct 2013 14:56:39 +0200 Subject: [PATCH] Additional usage fixes These should be the last --- wcfsetup/install/files/lib/util/CLIUtil.class.php | 4 ++-- wcfsetup/install/files/lib/util/StringUtil.class.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/util/CLIUtil.class.php b/wcfsetup/install/files/lib/util/CLIUtil.class.php index e866127d74..89f2e8715b 100644 --- a/wcfsetup/install/files/lib/util/CLIUtil.class.php +++ b/wcfsetup/install/files/lib/util/CLIUtil.class.php @@ -27,7 +27,7 @@ final class CLIUtil { $i = 0; foreach ($row as $column) { if (!isset($columnSize[$i])) $columnSize[$i] = 0; - $columnSize[$i] = max($columnSize[$i], StringUtil::length(AnsiUtil::stripAnsi($column))); + $columnSize[$i] = max($columnSize[$i], mb_strlen(AnsiUtil::stripAnsi($column))); $i++; } } @@ -44,7 +44,7 @@ final class CLIUtil { $i = 0; foreach ($row as $column) { $paddedString = StringUtil::pad(AnsiUtil::stripAnsi($column), $columnSize[$i], ' ', (is_numeric($column) ? STR_PAD_LEFT : STR_PAD_RIGHT)); - $result .= ' '.StringUtil::replace(AnsiUtil::stripAnsi($column), $column, $paddedString).' |'; + $result .= ' '.str_replace(AnsiUtil::stripAnsi($column), $column, $paddedString).' |'; $i++; } diff --git a/wcfsetup/install/files/lib/util/StringUtil.class.php b/wcfsetup/install/files/lib/util/StringUtil.class.php index 7589fbfe85..a348706695 100644 --- a/wcfsetup/install/files/lib/util/StringUtil.class.php +++ b/wcfsetup/install/files/lib/util/StringUtil.class.php @@ -376,7 +376,7 @@ final class StringUtil { */ public static function split($string, $length = 1) { $result = array(); - for ($i = 0, $max = self::length($string); $i < $max; $i += $length) { + for ($i = 0, $max = mb_strlen($string); $i < $max; $i += $length) { $result[] = mb_substr($string, $i, $length); } return $result; @@ -422,7 +422,7 @@ final class StringUtil { * Alias to php str_pad function with multibyte support. */ public static function pad($input, $padLength, $padString=' ', $padType=STR_PAD_RIGHT) { - $additionalPadding = strlen($input) - self::length($input); + $additionalPadding = strlen($input) - mb_strlen($input); return str_pad($input, $padLength + $additionalPadding, $padString, $padType); } -- 2.20.1