From: Peter Knut Date: Wed, 29 Jan 2025 11:21:56 +0000 (+0100) Subject: Modify naming of new foreign rows X-Git-Tag: v4.16.0~50 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=fdd02a548579dc687c562a87cbcc0acb155d21e0;p=adminer.git Modify naming of new foreign rows Regexp is used to unify implementation with other similar situations. This also prevents false detection in CodeQL security scanning. --- diff --git a/adminer/static/editing.js b/adminer/static/editing.js index d91e1f8b..6478af35 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -561,7 +561,7 @@ function foreignAddRow() { this.onchange = function () { }; var selects = qsa('select', row); for (var i=0; i < selects.length; i++) { - selects[i].name = selects[i].name.replace(']', '1]'); + selects[i].name = selects[i].name.replace(/\d+]/, '1$&'); selects[i].selectedIndex = 0; } parentTag(this, 'table').appendChild(row);