Skip to content

Commit

Permalink
Merge pull request DSpace#3481 from DSpace/alert-autofix-6
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 6: Incomplete string escaping or encoding
  • Loading branch information
tdonohue authored Oct 23, 2024
2 parents ea8f24d + 372444c commit abd0d69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/core/shared/metadata.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class Metadata {
const outputKeys: string[] = [];
for (const inputKey of inputKeys) {
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)) {
if (!outputKeys.includes(mapKey) && inputKeyRegex.test(mapKey)) {
outputKeys.push(mapKey);
Expand Down

0 comments on commit abd0d69

Please sign in to comment.