solomax commented on a change in pull request #378: WICKET-6688 add RFC support 
(to avoid unsafe eval)
URL: https://github.com/apache/wicket/pull/378#discussion_r304836583
 
 

 ##########
 File path: 
wicket-core/src/main/java/org/apache/wicket/ajax/RemoteFunctionCallUtils.java
 ##########
 @@ -0,0 +1,45 @@
+package org.apache.wicket.ajax;
+
+import com.github.openjson.JSONArray;
+import com.github.openjson.JSONObject;
+import org.apache.wicket.util.string.Strings;
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+public class RemoteFunctionCallUtils
+{
+       public static String createFunctionJsonString(CharSequence 
functionName, Object... args)
+       {
+               return "{\"" +
 
 Review comment:
   I would change this to be:
   ```
   return new JSONObject().put("func", functionName).put("args", new 
JSONArray().put(..........).toString();
   ```
   IMO the code will be much cleaner
   WDYT?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to