You've already forked phpmyadmin
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:
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user