From c2047b3b9482411446303bb8882d9f4d19421a29 Mon Sep 17 00:00:00 2001 From: Dave Hoover Date: Thu, 9 Jun 2016 07:43:39 -0500 Subject: [PATCH] Safer handling of imports with leading ./ --- src/app/compiler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/compiler.js b/src/app/compiler.js index 38b4e4c896..0df03bc793 100644 --- a/src/app/compiler.js +++ b/src/app/compiler.js @@ -203,7 +203,11 @@ function Compiler (editor, handleGithubCall, outputField, hidingRHP, updateFiles for (var fileName in files) { var match; while ((match = importRegex.exec(files[fileName]))) { - importHints.push(match[1]); + var importFilePath = match[1]; + if (importFilePath.startsWith('./')) { + importFilePath = importFilePath.slice(2); + } + importHints.push(importFilePath); } } while (importHints.length > 0) {