mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 09:34:10 +02:00
MongoDB: Fix parsing WHERE condition from SQL query
Thanks to herobank110 (https://github.com/vrana/adminer/pull/491)
This commit is contained in:
@@ -480,7 +480,11 @@ if (isset($_GET["mongo"])) {
|
||||
}
|
||||
|
||||
function sql_query_where_parser($queryWhere) {
|
||||
$queryWhere = preg_replace('~^\sWHERE \(?\(?(.+?)\)?\)?$~', '\1', $queryWhere);
|
||||
$queryWhere = preg_replace('~^\s*WHERE\s*~', "", $queryWhere);
|
||||
while ($queryWhere[0] == "(") {
|
||||
$queryWhere = preg_replace('~^\((.*)\)$~', "$1", $queryWhere);
|
||||
}
|
||||
|
||||
$wheres = explode(' AND ', $queryWhere);
|
||||
$wheresOr = explode(') OR (', $queryWhere);
|
||||
$where = array();
|
||||
|
Reference in New Issue
Block a user