1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-22 02:35:47 +01:00

Minor cleanup.

This commit is contained in:
Kris Maglione
2009-11-02 22:05:03 -05:00
parent 8224540d26
commit c159cf6efa
2 changed files with 3 additions and 8 deletions

View File

@@ -739,7 +739,7 @@ function Bookmarks() //{{{
if (!shortcutURL) if (!shortcutURL)
return [url, null]; return [url, null];
let data = unescape(postData || ""); let data = window.unescape(postData || "");
if (/%s/i.test(shortcutURL) || /%s/i.test(data)) if (/%s/i.test(shortcutURL) || /%s/i.test(data))
{ {
var charset = ""; var charset = "";
@@ -764,9 +764,7 @@ function Bookmarks() //{{{
postData = window.getPostDataStream(data, param, encodedParam, "application/x-www-form-urlencoded"); postData = window.getPostDataStream(data, param, encodedParam, "application/x-www-form-urlencoded");
} }
else if (param) else if (param)
{ return [shortcutURL, null];
return [url, null];
}
return [shortcutURL, postData]; return [shortcutURL, postData];
} }

View File

@@ -2140,10 +2140,7 @@ function StatusLine() //{{{
// ripped from Firefox; modified // ripped from Firefox; modified
function losslessDecodeURI(url) { function losslessDecodeURI(url) {
// 1. decodeURI decodes %25 to %, which creates unintended // 1. decodeURI decodes %25 to %, which creates unintended
// encoding sequences. Re-encode it, unless it's part of // encoding sequences.
// a sequence that survived decodeURI, i.e. one for:
// ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '#'
// (RFC 3987 section 3.2)
url = url.split("%25").map(decodeURI).join("%25"); url = url.split("%25").map(decodeURI).join("%25");
// 2. Re-encode whitespace so that it doesn't get eaten away // 2. Re-encode whitespace so that it doesn't get eaten away
// by the location bar (bug 410726). // by the location bar (bug 410726).