From fdd02a548579dc687c562a87cbcc0acb155d21e0 Mon Sep 17 00:00:00 2001 From: Peter Knut Date: Wed, 29 Jan 2025 12:21:56 +0100 Subject: [PATCH] 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. --- adminer/static/editing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);