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);
|
||||||
|
|
||||||
@@ -446,7 +448,7 @@ if (!$columns && support("table")) {
|
|||||||
$link .= where_link($i++, $k, $v);
|
$link .= where_link($i++, $k, $v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$val = select_value($val, $link, $field, $text_length);
|
$val = select_value($val, $link, $field, $text_length);
|
||||||
$id = h("val[$unique_idf][" . bracket_escape($key) . "]");
|
$id = h("val[$unique_idf][" . bracket_escape($key) . "]");
|
||||||
$value = $_POST["val"][$unique_idf][bracket_escape($key)];
|
$value = $_POST["val"][$unique_idf][bracket_escape($key)];
|
||||||
@@ -507,7 +509,7 @@ if (!$columns && support("table")) {
|
|||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<div class='footer'><div>\n";
|
echo "<div class='footer'><div>\n";
|
||||||
if ($rows || $page) {
|
if ($rows || $page) {
|
||||||
if ($pagination) {
|
if ($pagination) {
|
||||||
@@ -539,7 +541,7 @@ if (!$columns && support("table")) {
|
|||||||
}
|
}
|
||||||
echo "</fieldset>\n";
|
echo "</fieldset>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<fieldset>";
|
echo "<fieldset>";
|
||||||
echo "<legend>" . lang('Whole result') . "</legend>";
|
echo "<legend>" . lang('Whole result') . "</legend>";
|
||||||
$display_rows = ($exact_count ? "" : "~ ") . $found_rows;
|
$display_rows = ($exact_count ? "" : "~ ") . $found_rows;
|
||||||
|
Reference in New Issue
Block a user