Switch from encodeURIComponent to encodeURI - revised fix for #290

This commit is contained in:
Tom Morris 2013-08-06 13:35:34 -04:00
parent 0c483fa9f6
commit 71a9d2e0af

View File

@ -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 = $('<iframe></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);