From 807fcec4e3e5cd75b4c39f91f60d906fb11062b7 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Thu, 27 Dec 2018 14:44:37 +0300 Subject: [PATCH] fix(interpolateName): potential issue in hash and contenthash regexp --- lib/interpolateName.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/interpolateName.js b/lib/interpolateName.js index cfe2ec0..d1fa661 100644 --- a/lib/interpolateName.js +++ b/lib/interpolateName.js @@ -91,7 +91,7 @@ function interpolateName(loaderContext, name, options) { // `hash` and `contenthash` are same in `loader-utils` context // let's keep `hash` for backward compatibility .replace( - /\[(?:([^:\]]+):)?(?:hash||contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi, + /\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi, (all, hashType, digestType, maxLength) => getHashDigest(content, hashType, digestType, parseInt(maxLength, 10)) )