Skip to content

Commit abd0d69

Browse files
authored
Merge pull request #3481 from DSpace/alert-autofix-6
Fix code scanning alert no. 6: Incomplete string escaping or encoding
2 parents ea8f24d + 372444c commit abd0d69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/core/shared/metadata.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class Metadata {
163163
const outputKeys: string[] = [];
164164
for (const inputKey of inputKeys) {
165165
if (inputKey.includes('*')) {
166-
const inputKeyRegex = new RegExp('^' + inputKey.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$');
166+
const inputKeyRegex = new RegExp('^' + inputKey.replace(/\\/g, '\\\\').replace(/\./g, '\\.').replace(/\*/g, '.*') + '$');
167167
for (const mapKey of Object.keys(mdMap)) {
168168
if (!outputKeys.includes(mapKey) && inputKeyRegex.test(mapKey)) {
169169
outputKeys.push(mapKey);

0 commit comments

Comments
 (0)