Commit 77ea400d authored by jarekj's avatar jarekj Committed by Steve Müller

Update QueryBuilder.php

getSQLForJoins - infinite recursion if join alias is not unique
parent 96b7a7fb
...@@ -1148,6 +1148,9 @@ class QueryBuilder ...@@ -1148,6 +1148,9 @@ class QueryBuilder
$sql = ''; $sql = '';
if (isset($this->sqlParts['join'][$fromAlias])) { if (isset($this->sqlParts['join'][$fromAlias])) {
if (array_key_exists($join['joinAlias'], $knownAliases)) {
throw QueryException::aliasNotUnique($join['joinAlias']);
}
foreach ($this->sqlParts['join'][$fromAlias] as $join) { foreach ($this->sqlParts['join'][$fromAlias] as $join) {
$sql .= ' ' . strtoupper($join['joinType']) $sql .= ' ' . strtoupper($join['joinType'])
. ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias'] . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment