From b89eb07c6e81a04a1e4ea514c983ef2898201980 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 7 Jun 2013 11:11:19 -0700 Subject: [PATCH] URI encode parameter values Previously the path to open would not open properly if it contained a '&' character since the character was not encoded and would cause the parameter parsing to stop at the first '&'. --- src/atom-window.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/atom-window.coffee b/src/atom-window.coffee index 19a27e8d8..0bb10e7f0 100644 --- a/src/atom-window.coffee +++ b/src/atom-window.coffee @@ -12,8 +12,10 @@ class AtomWindow @browserWindow = new BrowserWindow show: false, title: 'Atom' @handleEvents() - url = "file://#{resourcePath}/static/index.html#bootstrapScript=#{bootstrapScript}&resourcePath=#{resourcePath}" - url += "&pathToOpen=#{@pathToOpen}" if @pathToOpen + url = "file://#{resourcePath}/static/index.html#" + url += "bootstrapScript=#{encodeURIComponent(bootstrapScript)}" + url += "&resourcePath=#{encodeURIComponent(resourcePath)}" + url += "&pathToOpen=#{encodeURIComponent(@pathToOpen)}" if @pathToOpen url += '&exitWhenDone=1' if exitWhenDone @browserWindow.loadUrl url