Fix EDU-654 partially: remove all non-alphanumeric symbols from course name
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Wed, 29 Jun 2016 08:00:41 +0000 (11:00 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Wed, 29 Jun 2016 08:03:15 +0000 (11:03 +0300)
python/educational-core/student/src/com/jetbrains/edu/learning/stepic/EduStepicConnector.java

index 665586af22a2acb7b8b223950ae71d6549b841e4..e472f4350d0d2d03773ec87a16c1e7f632f6cd39 100644 (file)
@@ -1,6 +1,8 @@
 package com.jetbrains.edu.learning.stepic;
 
-import com.google.gson.*;
+import com.google.gson.FieldNamingPolicy;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.application.ModalityState;
 import com.intellij.openapi.diagnostic.Logger;
@@ -297,6 +299,9 @@ public class EduStepicConnector {
           info.addAuthor(author);
         }
 
+        String name = info.getName().replaceAll("[^a-zA-Z0-9\\s]", "");
+        info.setName(name.trim());
+        
         result.add(info);
       }
     }