Escape use of commons.wikimedia.org in regular expression

Dots needs escaping

resources\mmv\model\mmv.model.Repo.js
  129:11  warning  Unsafe Regular Expression
security/detect-unsafe-regex
  169:11  warning  Unsafe Regular Expression
security/detect-unsafe-regex

The plugin does not like the backtracking for "https?", but that does
not looks like a performance problem when given long strings here.

Change-Id: Iac4c88b591c2e8ebb2ce037bbd99b774319a261c
This commit is contained in:
Umherirrender 2023-08-10 00:30:27 +02:00
parent 5ed21318bc
commit b4e7477150

View file

@ -126,7 +126,8 @@
* @inheritdoc
*/
isCommons() {
return /^(https?:)?\/\/commons.wikimedia.org/.test( this.server );
// eslint-disable-next-line security/detect-unsafe-regex
return /^(https?:)?\/\/commons\.wikimedia\.org/.test( this.server );
}
}
@ -166,7 +167,8 @@
* @inheritdoc
*/
isCommons() {
return /^(https?:)?\/\/commons.wikimedia.org/.test( this.descBaseUrl );
// eslint-disable-next-line security/detect-unsafe-regex
return /^(https?:)?\/\/commons\.wikimedia\.org/.test( this.descBaseUrl );
}
}