Skip to content

Commit

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

Please sign in to comment.