mirror of
https://github.com/vrana/adminer.git
synced 2025-08-18 04:11:27 +02:00
Use <script> instead of inline event handler in confirm()
This commit is contained in:
@@ -58,7 +58,7 @@ function connect_error() {
|
||||
echo (support("database")
|
||||
? "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n"
|
||||
. "<input type='hidden' name='all' value=''><script>qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^db/)); };</script>\n" // used by trCheck()
|
||||
. "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n"
|
||||
. "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm() . "\n"
|
||||
. "</div></fieldset>\n"
|
||||
: ""
|
||||
);
|
||||
|
@@ -189,10 +189,11 @@ function select_input($attrs, $options, $value = "", $onchange = "", $placeholde
|
||||
}
|
||||
|
||||
/** Get onclick confirmation
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function confirm() {
|
||||
return " onclick=\"return confirm('" . lang('Are you sure?') . "');\"";
|
||||
function confirm($selector = "qsl('input')") {
|
||||
return "<script>$selector.onclick = function () { return confirm('" . lang('Are you sure?') . "'); };</script>";
|
||||
}
|
||||
|
||||
/** Print header for hidden fieldset (close by </div></fieldset>)
|
||||
@@ -1385,7 +1386,7 @@ function edit_form($TABLE, $fields, $row, $update) {
|
||||
) . "' title='Ctrl+Shift+Enter'>\n";
|
||||
}
|
||||
}
|
||||
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n"
|
||||
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'>" . confirm() . "\n"
|
||||
: ($_POST || !$fields ? "" : "<script>focus(qsa('td', qs('#form'))[1].firstChild);</script>\n")
|
||||
);
|
||||
if (isset($_GET["select"])) {
|
||||
|
Reference in New Issue
Block a user