Skip to content

Commit

Permalink
fix(interpolateName): potential issue in hash and contenthash regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Dec 27, 2018
1 parent 809b690 commit 807fcec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/interpolateName.js
Expand Up @@ -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))
)
Expand Down

0 comments on commit 807fcec

Please sign in to comment.