diff --git a/src/CodingContractGenerator.ts b/src/CodingContractGenerator.ts index 9ec41ca0c..9f913ed48 100644 --- a/src/CodingContractGenerator.ts +++ b/src/CodingContractGenerator.ts @@ -191,7 +191,8 @@ function getRandomFilename(server: BaseServer, reward: ICodingContractReward): s } if (reward.name) { - contractFn += `-${reward.name.replace(/\s/g, "")}`; + // Only alphanumeric characters in the reward name. + contractFn += `-${reward.name.replace(/[^a-zA-Z0-9]/g, "")}`; } return contractFn;