diff --git a/static/js/embedDialog.js b/static/js/embedDialog.js
index e5a45f68f..3348e7054 100644
--- a/static/js/embedDialog.js
+++ b/static/js/embedDialog.js
@@ -290,10 +290,7 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) {
? '%' + char.charCodeAt(0).toString(16).toUpperCase()
: char;
});
- return ret.replace(/_/g, '%09')
- .replace(/\s/g, '_')
- .replace(//g, '%0F');
+ return pandora.escapeQueryValue(ret);
}
function getForm() {
diff --git a/static/js/infoView.0xdb.js b/static/js/infoView.0xdb.js
index ee7f1d6c7..c93046e8e 100644
--- a/static/js/infoView.0xdb.js
+++ b/static/js/infoView.0xdb.js
@@ -781,7 +781,7 @@ pandora.ui.infoView = function(data) {
function formatValue(value, key) {
return (Ox.isArray(value) ? value : [value]).map(function(value) {
return key ?
- '' + value + ''
+ '' + value + ''
: value;
}).join(', ');
}
diff --git a/static/js/infoView.indiancinema.js b/static/js/infoView.indiancinema.js
index 28f33fe0a..8da847a63 100644
--- a/static/js/infoView.indiancinema.js
+++ b/static/js/infoView.indiancinema.js
@@ -694,7 +694,7 @@ pandora.ui.infoView = function(data) {
return key
? '' + value + ''
+ ) + '=' + pandora.escapeQueryValue(value) + '">' + value + ''
: value;
}).join(Ox.contains(specialListKeys, key) ? '; ' : ', ');
}
diff --git a/static/js/infoView.padma.js b/static/js/infoView.padma.js
index 66167e681..c4f47cfb6 100644
--- a/static/js/infoView.padma.js
+++ b/static/js/infoView.padma.js
@@ -586,7 +586,7 @@ pandora.ui.infoView = function(data) {
function formatLink(key, value, linkValue) {
return (Ox.isArray(value) ? value : [value]).map(function(value) {
return key
- ? '' + value + ''
+ ? '' + value + ''
: value;
}).join(', ');
}
diff --git a/static/js/insertEmbedDialog.js b/static/js/insertEmbedDialog.js
index f62720f02..a511f7eb9 100644
--- a/static/js/insertEmbedDialog.js
+++ b/static/js/insertEmbedDialog.js
@@ -442,7 +442,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
var data = Ox.map($input, function($element) {
return $element.options('value');
}),
- options = Ox.serialize({
+ options = pandora.escapeQueryValue(Ox.serialize({
title: data.title || void 0,
showTimeline: data.showTimeline || void 0,
timeline: data.timeline && data.timeline != 'default'
@@ -451,8 +451,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
showLayers: data.showAnnotations && data.showLayers
? data.showLayers : void 0,
//matchRatio: true
- }, true)
- .replace(/_/g, '%09').replace(/\s/g, '_')
+ }, true))
.replace(/"/g, '"');
url = data.protocol + '://'
+ data.site + '/'
diff --git a/static/js/utils.js b/static/js/utils.js
index d1b190ca3..e18560fec 100644
--- a/static/js/utils.js
+++ b/static/js/utils.js
@@ -1046,6 +1046,13 @@ pandora.enableDragAndDrop = function($list, canMove, section, getItems) {
};
+pandora.escapeQueryValue = function(value) {
+ return value.replace(/_/g, '%09')
+ .replace(/\s/g, '_')
+ .replace(//g, '%0F');
+};
+
pandora.enterFullscreen = function() {
pandora.$ui.appPanel.size(0, 0);
if (pandora.user.ui.showSidebar) {