Merge pull request #124782 from rluvaton/patch-1

fix regex escaping
This commit is contained in:
Sandeep Somavarapu
2021-06-08 15:10:01 +02:00
committed by GitHub
@@ -255,7 +255,7 @@ function getCoreTranslationAssets(version: IRawGalleryExtensionVersion): [string
function getRepositoryAsset(version: IRawGalleryExtensionVersion): IGalleryExtensionAsset | null {
if (version.properties) {
const results = version.properties.filter(p => p.key === AssetType.Repository);
const gitRegExp = new RegExp('((git|ssh|http(s)?)|(git@[\w.]+))(:(//)?)([\w.@\:/\-~]+)(.git)(/)?');
const gitRegExp = new RegExp('((git|ssh|http(s)?)|(git@[\\w.]+))(:(//)?)([\\w.@\:/\\-~]+)(.git)(/)?');
const uri = results.filter(r => gitRegExp.test(r.value))[0];
return uri ? { uri: uri.value, fallbackUri: uri.value } : null;