Bugfix: GotoAgent did not work with paths containing spaces (like "Brackets Sprint 14") #1748

Merged
merged 2 commits into from Oct 3, 2012

Conversation

Projects
None yet
2 participants
@DennisKehrig
Contributor

DennisKehrig commented Oct 2, 2012

No description provided.

Bugfix: If characters in URLs are encoded (e.g. space as %20), it nee…
…ds to be decoded before turning it into a file system path

@ghost ghost assigned redmunds Oct 3, 2012

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);

This comment has been minimized.

Show comment Hide comment
@redmunds

redmunds Oct 3, 2012

Contributor

When decoding an entire URL, you should use decodeURI(). decodeURIComponent is used when decoding individual pieces (i.e. components) of a URI .

@redmunds

redmunds Oct 3, 2012

Contributor

When decoding an entire URL, you should use decodeURI(). decodeURIComponent is used when decoding individual pieces (i.e. components) of a URI .

@DennisKehrig

This comment has been minimized.

Show comment Hide comment
@DennisKehrig

DennisKehrig Oct 3, 2012

Contributor

Of course, that's better. He're you go!

Contributor

DennisKehrig commented Oct 3, 2012

Of course, that's better. He're you go!

redmunds added a commit that referenced this pull request Oct 3, 2012

Merge pull request #1748 from DennisKehrig/dk/url-decode
Bugfix: GotoAgent did not work with paths containing spaces (like "Brackets Sprint 14")

@redmunds redmunds merged commit 943433f into adobe:master Oct 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment