1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-28 07:41:55 +03:00

Replace FROM clause aliases only if FROM clause is present

Fix #12579

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
This commit is contained in:
Deven Bansod
2016-09-28 19:23:12 +05:30
parent a1c27b957c
commit 59cd9bf3a1

View File

@@ -67,13 +67,15 @@ if (! empty($sql_query)) {
}
// Rebuilding the SELECT and FROM clauses.
$replaces = array(
array(
'FROM', 'FROM ' . SqlParser\Components\ExpressionArray::build(
$parser->statements[0]->from
if (count($parser->statements[0]->from) > 0) {
$replaces = array(
array(
'FROM', 'FROM ' . SqlParser\Components\ExpressionArray::build(
$parser->statements[0]->from
),
),
),
);
);
}
// Checking if the WHERE clause has to be replaced.
if ((!empty($where_clause)) && (is_array($where_clause))) {