benitlux: percent encode GET args
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 12 Oct 2016 15:55:29 +0000 (11:55 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 12 Oct 2016 16:49:29 +0000 (12:49 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/benitlux/src/client/views/social_views.nit
contrib/benitlux/src/client/views/user_views.nit

index f9d5b5f..7983ea7 100644 (file)
@@ -66,7 +66,7 @@ class SocialWindow
                var query = txt_query.text
                if query == null or query.is_empty then return
 
-               var res = "rest/search?token={app.token}&query={query}&offset=0"
+               var res = "rest/search?token={app.token}&query={query.to_percent_encoding}&offset=0"
                (new ListUsersAction(self, res)).start
        end
 
index e485d4b..ff5f31c 100644 (file)
@@ -146,7 +146,7 @@ class SignupWindow
 
                                if sender == but_login then
                                        feedback "Logging in...".t
-                                       (new LoginOrSignupAction(self, "rest/login?name={name}&pass={pass.pass_hash}")).start
+                                       (new LoginOrSignupAction(self, "rest/login?name={name.to_percent_encoding}&pass={pass.pass_hash}")).start
                                else if sender == but_signup then
                                        if pass != txt_pass2.text then
                                                feedback "Passwords do not match.".t
@@ -160,7 +160,7 @@ class SignupWindow
                                        end
 
                                        feedback "Signing up...".t
-                                       (new LoginOrSignupAction(self, "rest/signup?name={name}&pass={pass.pass_hash}&email={email}")).start
+                                       (new LoginOrSignupAction(self, "rest/signup?name={name.to_percent_encoding}&pass={pass.pass_hash}&email={email.to_percent_encoding}")).start
                                end
                        end
                end