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); } /**