1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 16:17:48 +02:00

Remove nested array

This commit is contained in:
Jakub Vrana
2018-02-07 12:42:46 +01:00
parent 42eec7d728
commit 06660882b5

View File

@@ -10,18 +10,18 @@ class AdminerEnumOption {
function editInput($table, $field, $attrs, $value) { function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") { if ($field["type"] == "enum") {
$options = array("" => array()); $options = array();
$selected = $value; $selected = $value;
if (isset($_GET["select"])) { if (isset($_GET["select"])) {
$options[""][-1] = lang('original'); $options[-1] = lang('original');
} }
if ($field["null"]) { if ($field["null"]) {
$options[""][""] = "NULL"; $options[""] = "NULL";
if ($value === null && !isset($_GET["select"])) { if ($value === null && !isset($_GET["select"])) {
$selected = ""; $selected = "";
} }
} }
$options[""][0] = lang('empty'); $options[0] = lang('empty');
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches); preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) { foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val)); $val = stripcslashes(str_replace("''", "'", $val));