Skip to content

Commit

Permalink
Escape single quotes in login inputs (Fix #101)
Browse files Browse the repository at this point in the history
  • Loading branch information
therealsujitk committed Jan 17, 2024
1 parent cc9013b commit 377d8e4
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,10 @@ public void signIn(final String captcha) {
webView.evaluateJavascript("(function() {" +
"if (typeof captchaInterval != 'undefined') clearInterval(captchaInterval);" +
"if (typeof executeInterval != 'undefined') clearInterval(executeInterval);" +
"var credentials = 'uname=" + username + "&passwd=' + encodeURIComponent('" + password + "') + '&" + captcha + "';" +
"$('#vtopLoginForm [name=\"username\"]').val('" + username + "');" +
"$('#vtopLoginForm [name=\"password\"]').val('" + password + "');" +
"$('#vtopLoginForm [name=\"captchaStr\"]').val('" + captcha + "');" +
"$('#vtopLoginForm [name=\"gResponse\"]').val('" + captcha + "');" +
"$('#vtopLoginForm [name=\"username\"]').val('" + username.replaceAll("'", "\\\\'") + "');" +
"$('#vtopLoginForm [name=\"password\"]').val('" + password.replaceAll("'", "\\\\'") + "');" +
"$('#vtopLoginForm [name=\"captchaStr\"]').val('" + captcha.replaceAll("'", "\\\\'") + "');" +
"$('#vtopLoginForm [name=\"gResponse\"]').val('" + captcha.replaceAll("'", "\\\\'") + "');" +
"var response = {" +
" authorised: false," +
" error_message: null," +
Expand Down

0 comments on commit 377d8e4

Please sign in to comment.