瀏覽代碼

Add check for validation playground id

Gary Hsu 7 年之前
父節點
當前提交
03a276471a
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      tests/validation/validation.js

+ 6 - 0
tests/validation/validation.js

@@ -217,6 +217,12 @@ function runTest(index, done) {
             });
     }
     else if (test.playgroundId) {
+        if (test.playgroundId[0] !== "#" || test.playgroundId.indexOf("#", 1) === -1) {
+            console.error("Invalid playground id");
+            done(false);
+            return;
+        }
+
         var snippetUrl = "//babylonjs-api2.azurewebsites.net/snippets";
         var pgRoot = "/Playground"
         var xmlHttp = new XMLHttpRequest();