From 7caeb19c1c9a179beeb1dc58d2c2890a43583bee Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 18 Dec 2011 17:22:17 +0100 Subject: only calculate field lengths for cli clients Signed-off-by: Florian Pritz --- application/controllers/file.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'application/controllers/file.php') 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; + } } } } -- cgit v1.2.3-24-g4f1b