Skip to content

Commit

Permalink
Fixes #14150
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed May 12, 2017
1 parent b7f0495 commit c6ab3f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@ public function getTablesUsedInFrom()
// Clean up table names and aliases
$cleanedUpTableNames = [];
foreach ($tableNames as $alias => $tableName) {
if (preg_match('~{{(.*?)}}~', $tableName, $matches)) {
$alias = $tableName = $matches[1];
}

if (!is_string($alias)) {
if (preg_match('~^\s*([\'"`\[].*?[\'"`\]]|\w+)(?:(?:\s+(?:as)?\s*)([\'"`\[].*?[\'"`\]]|\w+))?\s*$~iu', $tableName, $matches)) {
if (isset($matches[1])) {
Expand Down

0 comments on commit c6ab3f8

Please sign in to comment.