1
0
mirror of https://github.com/vrana/adminer.git synced 2025-09-03 11:22:35 +02:00

Hide edited value if selected function will not use it

This commit is contained in:
Peter Knut
2024-10-02 11:08:13 +02:00
parent 1de9275f11
commit bf1d16cdb7
5 changed files with 61 additions and 35 deletions

View File

@@ -483,7 +483,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
return $return;
}
function editInput($table, $field, $attrs, $value) {
function editInput($table, $field, $attrs, $value, $function) {
if ($field["type"] == "enum") {
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
. enum_input("radio", $attrs, $field, ($value || isset($_GET["select"]) ? $value : 0), ($field["null"] ? "" : null))
@@ -511,7 +511,9 @@ qsl('div').onclick = whisperClick;", "")
$hint = lang('[yyyy]-mm-dd') . ($hint ? " [$hint]" : "");
}
if ($hint) {
return "<input value='" . h($value) . "'$attrs> ($hint)"; //! maxlength
return "<input"
. ($function != "now" ? " value='" . h($value) . "'" : " data-last-value='" . h($value) . "'")
. "$attrs> ($hint)"; //! maxlength
}
if (preg_match('~_(md5|sha1)$~i', $field["field"])) {
return "<input type='password' value='" . h($value) . "'$attrs>";