diff --git a/src/main/kotlin/io/gitlab/jfronny/sdom/actions/SDStatementAction.kt b/src/main/kotlin/io/gitlab/jfronny/sdom/actions/SDStatementAction.kt index 7212442..6969110 100644 --- a/src/main/kotlin/io/gitlab/jfronny/sdom/actions/SDStatementAction.kt +++ b/src/main/kotlin/io/gitlab/jfronny/sdom/actions/SDStatementAction.kt @@ -59,7 +59,8 @@ class SDStatementAction(name: String) : DumbAwareAction(name) { CoroutineScope(Job() + Dispatchers.IO).launch { val data = SDom.downloadProblemStatement(contest, problem) fun createTmpFile(): Path { - val path = Files.createTempFile("${problem.name}_${contest.name}", ".pdf") + val prefix = "${problem.name}_${contest.name}".replace("[^a-zA-Z0-9._-]".toRegex(), "_") + val path = Files.createTempFile(prefix, ".pdf") Files.write(path, data, StandardOpenOption.WRITE) return path }