mirror of
https://github.com/vrana/adminer.git
synced 2025-08-16 11:34:10 +02:00
Add support for "where" field privilege
In Elasticsearch, only indexed fields are searchable.
This commit is contained in:
@@ -571,7 +571,8 @@ class Adminer {
|
||||
$cols = array();
|
||||
foreach ($fields as $name => $field) {
|
||||
if (
|
||||
(preg_match('~^[-\d.' . (preg_match('~IN$~', $val["op"]) ? ',' : '') . ']+$~', $val["val"]) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
|
||||
isset($field["privileges"]["where"])
|
||||
&& (preg_match('~^[-\d.' . (preg_match('~IN$~', $val["op"]) ? ',' : '') . ']+$~', $val["val"]) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
|
||||
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || preg_match('~char|text|enum|set~', $field["type"]))
|
||||
&& (!preg_match('~date|timestamp~', $field["type"]) || preg_match('~^\d+-\d+-\d+~', $val["val"]))
|
||||
) {
|
||||
|
@@ -1069,7 +1069,7 @@ function fields_from_edit() {
|
||||
$name = bracket_escape($key, 1); // 1 - back
|
||||
$return[$name] = array(
|
||||
"field" => $name,
|
||||
"privileges" => array("insert" => 1, "update" => 1),
|
||||
"privileges" => array("insert" => 1, "update" => 1, "where" => 1),
|
||||
"null" => 1,
|
||||
"auto_increment" => ($key == $driver->primary),
|
||||
);
|
||||
|
Reference in New Issue
Block a user