Skip to content

Commit

Permalink
attempt to fix subscribe link encoding
Browse files Browse the repository at this point in the history
for #79
  • Loading branch information
collinbarrett committed Feb 25, 2017
1 parent decf8d7 commit 0eaa9e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion gs/html-factory.gs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function createHtmlArrayLinkButton(htmlType, url, listName) {
return "<a href=\"" + url + "\" title=\"Preview " + listName + " in your browser.\" class=\"button piwik_download\">View</a>";
break;
case "addUrl":
return "<a href=\"abp:subscribe?location=" + encodeUrlArray(url) + "&title=" + encodeUrlArray(listName) + "\" title=\"Subscribe to " + listName + " in your content blocker.\" class=\"button piwik_download\">Add</a>";
return "<a href=\"abp:subscribe?location=" + encodeURIComponent(url) + "&amp;title=" + encodeURIComponent(listName) + "\" title=\"Subscribe to " + listName + " in your content blocker.\" class=\"button piwik_download\">Add</a>";
break;
case "homeUrl":
return "<a href=\"" + url + "\" title=\"" + listName + " Home Page\" class=\"button\">Home</a>";
Expand Down
15 changes: 0 additions & 15 deletions gs/utilities.gs
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ function getColIndicesWithHeaderSubstring(sheet, colHeaderSubstring) {
return colIndices;
}

function encodeUrlArray(urlArray) {
if (urlArray instanceof Array) {
for (var i in urlArray) {
urlArray[i] = encodeUrlArray(urlArray[i]);
}
return urlArray;
} else {
if (urlArray) {
return encodeURI(urlArray);
} else {
return "";
}
}
}

function trimUrlSlugArray(slugArray) {
if (slugArray instanceof Array) {
for (var i in slugArray) {
Expand Down

0 comments on commit 0eaa9e6

Please sign in to comment.