pedrosans commented on code in PR #1504:
URL: https://github.com/apache/wicket/pull/1504#discussion_r3533140878


##########
wicket-core/src/main/java/org/apache/wicket/core/util/string/JavaScriptUtils.java:
##########
@@ -95,6 +95,29 @@ public static CharSequence escapeQuotesAndBackslash(final 
CharSequence input)
                return s;
        }
 
+       /**
+        * Removes the surrounding single quotes from a string after trimming
+        * leading and trailing whitespace.
+        *
+        * <p>Examples:</p>
+        * <pre>
+        * unquoteSingleQuoted(" 'url'   ") -> "url"
+        * unquoteSingleQuoted("'url'")     -> "url"
+        * unquoteSingleQuoted("''")        -> ""
+        * </pre>
+        *
+        * @param s the single-quoted string
+        * @return the contents between the outer single quotes
+        */
+       public static String unquoteSingleQuoted(String s)
+       {
+               if (s != null && s.trim().startsWith("'") && 
s.trim().endsWith("'"))

Review Comment:
   Hi, it's. I changed the code to use an auxiliary variable and to work like 
neighboring methods (assigning the return value) 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to