Skip to content

Commit 930d8ef

Browse files
authored
Merge pull request DSpace#3546 from DSpace/backport-3481-to-dspace-8_x
[Port dspace-8_x] Fix code scanning alert no. 6: Incomplete string escaping or encoding
2 parents 6198314 + bb84d86 commit 930d8ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)