diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js index 56273cf3d41e8ce85d58b125e75c399203e0a8f4..c21b5ec45b21638621e438b7ed4b7fedce3b8396 100644 --- a/themes/bootstrap3/js/common.js +++ b/themes/bootstrap3/js/common.js @@ -1,4 +1,4 @@ -/*global ajaxLoadTab, checkSaveStatuses, console, extractSource, hexEncode, Lightbox, path, rc4Encrypt, refreshCommentList, vufindString */ +/*global ajaxLoadTab, btoa, checkSaveStatuses, console, extractSource, hexEncode, Lightbox, path, rc4Encrypt, refreshCommentList, unescape, vufindString */ /* --- GLOBAL FUNCTIONS --- */ function htmlEncode(value){ @@ -203,8 +203,9 @@ function ajaxLogin(form) { // get the user entered password var password = form.password.value; - // encrypt the password with the salt - password = rc4Encrypt(salt, password); + // base-64 encode the password (to allow support for Unicode) + // and then encrypt the password with the salt + password = rc4Encrypt(salt, btoa(unescape(encodeURIComponent(password)))); // hex encode the encrypted password password = hexEncode(password); @@ -301,7 +302,7 @@ $(document).ready(function() { q:query, method:'getACSuggestions', searcher:searcher['searcher'], - type:$('#searchForm_type').val(), + type:$('#searchForm_type').val() }, dataType:'json', success: function(json) { @@ -315,7 +316,7 @@ $(document).ready(function() { cb([]); } } - }) + }); } } );