mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge pull request #3481 from DSpace/alert-autofix-6
Fix code scanning alert no. 6: Incomplete string escaping or encoding
This commit is contained in:
@@ -163,7 +163,7 @@ export class Metadata {
|
|||||||
const outputKeys: string[] = [];
|
const outputKeys: string[] = [];
|
||||||
for (const inputKey of inputKeys) {
|
for (const inputKey of inputKeys) {
|
||||||
if (inputKey.includes('*')) {
|
if (inputKey.includes('*')) {
|
||||||
const inputKeyRegex = new RegExp('^' + inputKey.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$');
|
const inputKeyRegex = new RegExp('^' + inputKey.replace(/\\/g, '\\\\').replace(/\./g, '\\.').replace(/\*/g, '.*') + '$');
|
||||||
for (const mapKey of Object.keys(mdMap)) {
|
for (const mapKey of Object.keys(mdMap)) {
|
||||||
if (!outputKeys.includes(mapKey) && inputKeyRegex.test(mapKey)) {
|
if (!outputKeys.includes(mapKey) && inputKeyRegex.test(mapKey)) {
|
||||||
outputKeys.push(mapKey);
|
outputKeys.push(mapKey);
|
||||||
|
Reference in New Issue
Block a user