From: Sascha Greuel Date: Thu, 10 Oct 2013 12:56:39 +0000 (+0200) Subject: Additional usage fixes X-Git-Tag: 2.0.0_Beta_11~34^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8f762ae6d74d1a791b5ea8b3062e8d7e22ed4c84;p=GitHub%2FWoltLab%2FWCF.git Additional usage fixes These should be the last --- 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); }