Fix URI encoding on register/login, also fix database escape bug

This commit is contained in:
calzoneman 2013-07-27 10:11:31 -04:00
parent c7aac027dd
commit b9e465b714
6 changed files with 40 additions and 26 deletions

View file

@ -49,7 +49,7 @@
var uname = readCookie("cytube_uname") || "";
var p = "";
if(uname && session) {
$.getJSON(WEB_URL+"/api/json/login?name="+uname+"&session="+session+"&callback=?", function(data) {
$.getJSON(WEB_URL+"/api/json/login?name="+encodeURIComponent(uname)+"&session="+session+"&callback=?", function(data) {
if(data.success) {
$(".loginform").remove();
createCookie("cytube_uname", uname, 7);
@ -63,7 +63,8 @@
var q = "";
$("#login").click(function() {
uname = $("#name").val();
q = "name=" + $("#name").val() + "&pw=" + $("#pw").val();
q = "name=" + encodeURIComponent($("#name").val())
+ "&pw=" + encodeURIComponent($("#pw").val());
$.getJSON(WEB_URL+"/api/json/login?"+q+"&callback=?", function(data) {
if(data.success) {
$(".loginform").remove();