Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated Zend\Mvc to used StringUtils

  • Loading branch information...
commit 954950d1e33497ab53edc6c7108d01d153d5e49f 1 parent c16b3ef
@marc-mabe authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php
View
7 library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php
@@ -26,6 +26,7 @@
use Zend\View\Model\ConsoleModel;
use Zend\Version\Version;
use Zend\Stdlib\ResponseInterface as Response;
+use Zend\Stdlib\StringUtils;
use Zend\Text\Table;
/**
@@ -389,6 +390,7 @@ protected function renderTable($data, $cols, $consoleWidth)
$result = '';
$padding = 2;
+
// If there is only 1 column, just concatenate it
if ($cols == 1) {
foreach ($data as $row) {
@@ -397,12 +399,15 @@ protected function renderTable($data, $cols, $consoleWidth)
return $result;
}
+ // Get the string wrapper supporting UTF-8 character encoding
+ $strWrapper = StringUtils::getWrapper('UTF-8');
+
// Determine max width for each column
$maxW = array();
for ($x = 1; $x <= $cols; $x += 1) {
$maxW[$x] = 0;
foreach ($data as $row) {
- $maxW[$x] = max($maxW[$x], mb_strlen($row[$x-1],'utf-8') + $padding * 2);
+ $maxW[$x] = max($maxW[$x], $strWrapper->strlen($row[$x-1],'UTF-8') + $padding * 2);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.