From 71a9d2e0af1cb70340dac4d32c3ce6ffd523ac3c Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Tue, 6 Aug 2013 13:35:34 -0400 Subject: [PATCH] Switch from encodeURIComponent to encodeURI - revised fix for #290 --- .../modules/core/scripts/views/data-table/cell-ui.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js index 079b5d22b..b972a5bf1 100644 --- a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js +++ b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js @@ -105,7 +105,7 @@ DataTableCellUI.prototype._render = function() { .appendTo(divContent); if (service && (service.view) && (service.view.url)) { - a.attr("href", service.view.url.replace("{{id}}", encodeURIComponent(match.id))); + a.attr("href", encodeURI(service.view.url.replace("{{id}}", match.id))); } else if (ReconciliationManager.isFreebaseIdOrMid(r.identifierSpace)) { a.attr("href", "http://www.freebase.com/view" + match.id); } @@ -149,7 +149,7 @@ DataTableCellUI.prototype._render = function() { .appendTo(li); if ((service) && (service.view) && (service.view.url)) { - a.attr("href", service.view.url.replace("{{id}}", encodeURIComponent(candidate.id))); + a.attr("href", encodeURI(service.view.url.replace("{{id}}", candidate.id))); } else if (ReconciliationManager.isFreebaseIdOrMid(r.identifierSpace)) { a.attr("href", "http://www.freebase.com/view" + candidate.id); } @@ -453,14 +453,14 @@ DataTableCellUI.prototype._previewCandidateTopic = function(candidate, elmt, pre .html(DOM.loadHTML("core", "scripts/views/data-table/cell-recon-preview-popup-header.html")); if (preview && preview.url) { // Service has a preview URL associated with it - var url = preview.srch.replace("{{id}}", encodeURIComponent(id)); + var url = encodeURI(preview.srch.replace("{{id}}", id)); var iframe = $('') .width(preview.width) .height(preview.height) .attr("src", url) .appendTo(fakeMenu); } else { // Otherwise use our internal preview - var url = DataTableCellUI.internalPreview.srchurl.replace("\${id}",encodeURIComponent(id)); + var url = encodeURI(DataTableCellUI.internalPreview.srchurl.replace("\${id}", id)); $.ajax(url,{dataType:"jsonp"}).done(function(searchResponse) { var data = searchResponse.result[0]; var html = $.suggest.suggest.create_flyout(data, preview.imgurl);