diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-12-18 17:22:17 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-12-18 17:22:17 +0100 |
commit | 7caeb19c1c9a179beeb1dc58d2c2890a43583bee (patch) | |
tree | e864aa15b44259dc2d25216f857cd73ac2111eca /application/controllers | |
parent | f502313f517af07b8edc8ef3d6ffee748831fd73 (diff) |
only calculate field lengths for cli clients
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers')
-rw-r--r-- | application/controllers/file.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php index 90e686c8d..0c2db3e0c 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -135,11 +135,13 @@ class File extends CI_Controller { foreach($query as $key => $item) { $query[$key]["date"] = date("r", $item["date"]); - // Keep track of longest string to pad plaintext output correctly - foreach($fields as $length_key) { - $len = mb_strlen($query[$key][$length_key]); - if ($len > $lengths[$length_key]) { - $lengths[$length_key] = $len; + if ($this->var->cli_client) { + // Keep track of longest string to pad plaintext output correctly + foreach($fields as $length_key) { + $len = mb_strlen($query[$key][$length_key]); + if ($len > $lengths[$length_key]) { + $lengths[$length_key] = $len; + } } } } |