From e678b77b5b227d9135b7a91063c65c4771479a53 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 1 Aug 2011 20:20:32 -0500 Subject: [PATCH] refactored wrap method for readability. --- system/db/query.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/system/db/query.php b/system/db/query.php index 3d7596b6..579a002d 100644 --- a/system/db/query.php +++ b/system/db/query.php @@ -635,12 +635,17 @@ private function wrap($value) { if (strpos(strtolower($value), ' as ') !== false) { - return $this->wrap_alias($value, $connection); + return $this->wrap_alias($value); } $wrap = $this->connection->wrapper(); - return implode('.', array_map(function($segment) use ($wrap) { return ($segment != '*') ? $wrap.$segment.$wrap : $segment; }, explode('.', $value))); + foreach (explode('.', $value) as $segment) + { + $wrapped[] = ($segment != '*') ? $wrap.$segment.$wrap : $segment; + } + + return implode('.', $wrapped); } /**