Skip to content

Commit

Permalink
Merge pull request #271 from akvo/issue/270-urlencode
Browse files Browse the repository at this point in the history
[#270] URLEncode phone number and IMEI
  • Loading branch information
Mark Westra committed Feb 24, 2015
2 parents ba86892 + ede4d66 commit 1bf5c3a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/org/akvo/flow/api/FlowApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ public class FlowApi {

public List<SurveyedLocale> getSurveyedLocales(long surveyGroup, String timestamp)
throws IOException, HttpException {
final String query = Param.IMEI + IMEI
final String query = Param.IMEI + URLEncode(IMEI)
+ "&" + Param.LAST_UPDATED + (!TextUtils.isEmpty(timestamp)? timestamp : "0")
+ "&" + Param.PHONE_NUMBER + PHONE_NUMBER
+ "&" + Param.PHONE_NUMBER + URLEncode(PHONE_NUMBER)
+ "&" + Param.SURVEY_GROUP + surveyGroup
+ "&" + Param.TIMESTAMP + getTimestamp();

Expand Down Expand Up @@ -137,9 +137,9 @@ private String getTimestamp() {

public static String getDeviceParams() {
Context context = FlowApp.getApp();
return Param.PHONE_NUMBER + URLEncode(StatusUtil.getPhoneNumber(context))
return Param.PHONE_NUMBER + URLEncode(PHONE_NUMBER)
+ "&" + Param.ANDROID_ID + URLEncode(PlatformUtil.getAndroidID(context))
+ "&" + Param.IMEI + URLEncode(StatusUtil.getImei(context))
+ "&" + Param.IMEI + URLEncode(IMEI)
+ "&" + Param.VERSION + URLEncode(PlatformUtil.getVersionName(context))
+ "&" + Param.DEVICE_ID + URLEncode(StatusUtil.getDeviceId(context));
}
Expand Down

0 comments on commit 1bf5c3a

Please sign in to comment.