Permalink
Browse files

Fixed crash when username contains illegal characters.

  • Loading branch information...
1 parent 5943506 commit f22e7d91cdd573c7a8df75124745f991e2c11fbe @HansPinckaers committed Jun 27, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/info/vanderkooy/ucheck/APIHandler.java
@@ -44,13 +44,13 @@ public int getKey(String username, String password) {
public String getProgress() {
String username = prefs.getUsername();
String key = prefs.getKey();
- return getWebPage("https://ucheck.nl/api/voortgang.php?user=" + username + "&pass=" + key);
+ return getWebPage("https://ucheck.nl/api/voortgang.php?user=" + URLEncoder.encode(username) + "&pass=" + key);
}
public JSONObject getGrades() {
String username = prefs.getUsername();
String key = prefs.getKey();
- String data = getWebPage("https://ucheck.nl/api/cijfers.php?user=" + username + "&pass=" + key);
+ String data = getWebPage("https://ucheck.nl/api/cijfers.php?user=" + URLEncoder.encode(username) + "&pass=" + key);
JSONObject obj;
try {
obj = new JSONObject(data);
@@ -64,7 +64,7 @@ public JSONObject getGrades() {
public JSONObject getClasses() {
String username = prefs.getUsername();
String key = prefs.getKey();
- String data = getWebPage("https://ucheck.nl/api/inschrijvingen.php?user=" + username + "&pass=" + key);
+ String data = getWebPage("https://ucheck.nl/api/inschrijvingen.php?user=" + URLEncoder.encode(username) + "&pass=" + key);
JSONObject obj;
try {
obj = new JSONObject(data);

0 comments on commit f22e7d9

Please sign in to comment.