Skip to content

Commit

Permalink
Merge pull request #3545 from DSpace/backport-3481-to-dspace-7_x
Browse files Browse the repository at this point in the history
[Port dspace-7_x] Fix code scanning alert no. 6: Incomplete string escaping or encoding
  • Loading branch information
tdonohue authored Oct 23, 2024
2 parents 7c6ecf8 + 9486ab5 commit 3deef34
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 @@ -157,7 +157,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 3deef34

Please sign in to comment.