From 7ee45e57c75cc13e242a375fc65f09005269e3bd Mon Sep 17 00:00:00 2001 From: ucorina Date: Tue, 22 Nov 2011 17:11:53 +0000 Subject: [PATCH] Subquery fix. git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9858 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/xml/xmlquery/tags/query/QueryTag.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/classes/xml/xmlquery/tags/query/QueryTag.class.php b/classes/xml/xmlquery/tags/query/QueryTag.class.php index 80da6c1ad..ac9a2a6c4 100644 --- a/classes/xml/xmlquery/tags/query/QueryTag.class.php +++ b/classes/xml/xmlquery/tags/query/QueryTag.class.php @@ -28,7 +28,10 @@ class QueryTag { $this->query = $query; $this->isSubQuery = $isSubQuery; if($this->isSubQuery) $this->action = 'select'; - $this->alias = $query->attrs->alias; + if($query->attrs->alias){ + $dbParser = DB::getParser(); + $this->alias = $dbParser->escape($query->attrs->alias); + } $this->join_type = $query->attrs->join_type; $this->getColumns(); @@ -48,7 +51,7 @@ class QueryTag { function getQueryId(){ return $this->query->attrs->query_id ? $this->query->attrs->query_id : $this->query->attrs->id; } - + function getPriority(){ return $this->query->attrs->priority; } @@ -112,7 +115,7 @@ class QueryTag { $buff = ''; if($this->isSubQuery){ $buff = 'new Subquery('; - $buff .= "'\"" . $this->alias . '"\', '; + $buff .= "'" . $this->alias . '\', '; $buff .= ($this->columns ? $this->columns->toString() : 'null' ). ', '.PHP_EOL; $buff .= $this->tables->toString() .','.PHP_EOL; $buff .= $this->conditions->toString() .',' .PHP_EOL;