mirror of
https://github.com/vrana/adminer.git
synced 2025-09-01 10:23:28 +02:00
Editor: Fix building links with array parameters
This solves a situation when enum data type has a foreign key to another table.
This commit is contained in:
@@ -232,14 +232,16 @@ if (is_ajax()) {
|
|||||||
|
|
||||||
$set = null;
|
$set = null;
|
||||||
if (isset($rights["insert"]) || !support("table")) {
|
if (isset($rights["insert"]) || !support("table")) {
|
||||||
$set = "";
|
$params = [];
|
||||||
foreach ((array) $_GET["where"] as $val) {
|
foreach ((array) $_GET["where"] as $val) {
|
||||||
if ($foreign_keys[$val["col"]] && count($foreign_keys[$val["col"]]) == 1 && ($val["op"] == "="
|
if (isset($foreign_keys[$val["col"]]) && count($foreign_keys[$val["col"]]) == 1
|
||||||
|| (!$val["op"] && !preg_match('~[_%]~', $val["val"])) // LIKE in Editor
|
&& ($val["op"] == "=" || (!$val["op"] && (is_array($val["val"]) || !preg_match('~[_%]~', $val["val"]))) // LIKE in Editor
|
||||||
)) {
|
)) {
|
||||||
$set .= "&set" . urlencode("[" . bracket_escape($val["col"]) . "]") . "=" . urlencode($val["val"]);
|
$params["set" . "[" . bracket_escape($val["col"]) . "]"] = $val["val"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$set = $params ? "&" . http_build_query($params) : "";
|
||||||
}
|
}
|
||||||
$adminer->selectLinks($table_status, $set);
|
$adminer->selectLinks($table_status, $set);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user