Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a fix for changing quotes into %22 #951

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions client/static/js/routers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PANDA.routers.Index = Backbone.Router.extend({
"*path": "not_found"
},

_percent_twenty_fix: function(param) {
_percent_fixes: function(param) {
/*
* The latest FF encodes urls in a non-standard way, as documented
* in these Backbone tickets:
Expand All @@ -42,8 +42,16 @@ PANDA.routers.Index = Backbone.Router.extend({
* changes made to work across browsers
* also fixes a related rendering error in the newest firefox
*/


/*
* Firefox, IE and Chrome also appear to be changing quotes into %22
* I have chained the fix onto the previous fix mentioned above and changed the name of the function
* from _percent_twenty_fix to _percent_fixes..
*/

if (param) {
return param.replace(/%20/g, " ");
return param.replace(/%20/g, " ").replace(/%22/g, '"');
} else {
return param;
}
Expand All @@ -70,23 +78,23 @@ PANDA.routers.Index = Backbone.Router.extend({
},

search: function(category, query, since, limit, page) {
this.controller.goto_search(category, this._percent_twenty_fix(query), since, limit, page);
this.controller.goto_search(category, this._percent_fixes(query), since, limit, page);
},

data_upload: function(dataset_slug) {
this.controller.goto_data_upload(dataset_slug);
},

datasets_search: function(category, query, limit, page) {
this.controller.goto_datasets_search(category, this._percent_twenty_fix(query), limit, page);
this.controller.goto_datasets_search(category, this._percent_fixes(query), limit, page);
},

dataset_view: function(slug) {
this.controller.goto_dataset_view(slug);
},

dataset_search: function(slug, query, since, limit, page) {
this.controller.goto_dataset_search(slug, this._percent_twenty_fix(query), since, limit, page);
this.controller.goto_dataset_search(slug, this._percent_fixes(query), since, limit, page);
},

notifications: function(limit, page) {
Expand Down