MongoDB: Use ObjectID only if used
This commit is contained in:
parent
5d317111c7
commit
a61a76716b
|
@ -300,10 +300,8 @@ if (isset($_GET["mongo"])) {
|
||||||
if (is_array($where)) {
|
if (is_array($where)) {
|
||||||
foreach ($where as $expression) {
|
foreach ($where as $expression) {
|
||||||
list($col, $op, $val) = explode(" ", $expression, 3);
|
list($col, $op, $val) = explode(" ", $expression, 3);
|
||||||
if ($col == "_id") {
|
if ($col == "_id" && preg_match('~^(MongoDB\\\\BSON\\\\ObjectID)\("(.+)"\)$~', $val, $match)) {
|
||||||
$val = str_replace('MongoDB\BSON\ObjectID("', "", $val);
|
list(, $class, $val) = $match;
|
||||||
$val = str_replace('")', "", $val);
|
|
||||||
$class = 'MongoDB\BSON\ObjectID';
|
|
||||||
$val = new $class($val);
|
$val = new $class($val);
|
||||||
}
|
}
|
||||||
if (!in_array($op, $adminer->operators)) {
|
if (!in_array($op, $adminer->operators)) {
|
||||||
|
|
Loading…
Reference in a new issue