Commit 5bf1da6f authored by Ryan Herbert's avatar Ryan Herbert
Browse files

database.js refactor call, fix trailing question mark

call would append trailing question mark to a URL which did not have any
args. This was causing some issues with some redirects, namely for the
login page.
parent 7bd98d93
......@@ -222,14 +222,16 @@ Database.prototype = {
{}
var self = this;
var url = self.db_address + page
if (page.substr(0,4).toLowerCase() == "http") {
url = page
}
var arg = "";
if (typeof args != "undefined" && Object.keys(args).length)
if (typeof args != "undefined" && Object.keys(args).length) {
var arg = this.argsToStr(args)
var url = self.db_address + page + "?" + arg
if (page.substr(0,4).toLowerCase() == "http") {
url = page + arg
url += "?" + arg;
}
this.callUrl(url, args)
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment