From c5170f21052d2db45602b9e85cbb1fc3a85cc312 Mon Sep 17 00:00:00 2001 From: Dennis Kehrig Date: Wed, 3 Oct 2012 00:04:40 +0200 Subject: [PATCH 1/2] Bugfix: If characters in URLs are encoded (e.g. space as %20), it needs to be decoded before turning it into a file system path --- src/LiveDevelopment/Agents/GotoAgent.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/LiveDevelopment/Agents/GotoAgent.js b/src/LiveDevelopment/Agents/GotoAgent.js index 3ba8580a321..3903cd86953 100644 --- a/src/LiveDevelopment/Agents/GotoAgent.js +++ b/src/LiveDevelopment/Agents/GotoAgent.js @@ -168,6 +168,8 @@ define(function GotoAgent(require, exports, module) { url = _urlWithoutQueryString(url); // Extract the path, also strip the third slash when on Windows var path = url.slice(brackets.platform === "win" ? 8 : 7); + // URL-decode the path ('%20' => ' ') + path = decodeURIComponent(path); var promise = DocumentManager.getDocumentForPath(path); promise.done(function onDone(doc) { DocumentManager.setCurrentDocument(doc); From e41de4aaef5816d36cd81c2ce19e1690e37fd2d6 Mon Sep 17 00:00:00 2001 From: Dennis Kehrig Date: Wed, 3 Oct 2012 11:29:42 +0200 Subject: [PATCH 2/2] Use decodeURI instead of decodeURIComponent --- src/LiveDevelopment/Agents/GotoAgent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LiveDevelopment/Agents/GotoAgent.js b/src/LiveDevelopment/Agents/GotoAgent.js index 3903cd86953..e944644bc50 100644 --- a/src/LiveDevelopment/Agents/GotoAgent.js +++ b/src/LiveDevelopment/Agents/GotoAgent.js @@ -169,7 +169,7 @@ define(function GotoAgent(require, exports, module) { // Extract the path, also strip the third slash when on Windows var path = url.slice(brackets.platform === "win" ? 8 : 7); // URL-decode the path ('%20' => ' ') - path = decodeURIComponent(path); + path = decodeURI(path); var promise = DocumentManager.getDocumentForPath(path); promise.done(function onDone(doc) { DocumentManager.setCurrentDocument(doc);