From 5c9e0f6d5aabe0a6d89098a7ca374c952e9f866b 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 2ab06749..eae42c41 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -548,7 +548,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);