click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1040077 - /click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
Date Mon, 29 Nov 2010 11:45:57 GMT
Author: sabob
Date: Mon Nov 29 11:45:57 2010
New Revision: 1040077

URL: http://svn.apache.org/viewvc?rev=1040077&view=rev
Log:
Fixed potential issue where menu can render duplicate slashes. CLK-733

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java?rev=1040077&r1=1040076&r2=1040077&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java Mon Nov 29 11:45:57
2010
@@ -1027,7 +1027,14 @@ public class Menu extends AbstractContro
                 // Guard against rendering "null" in the href
                 localPath = "";
             }
-            return context.getResponse().encodeURL(context.getRequest().getContextPath()
+ "/" + localPath);
+            StringBuilder sb = new StringBuilder();
+            String contextPath = context.getRequest().getContextPath();
+            sb.append(contextPath);
+            if (localPath.length() > 0 && localPath.charAt(0) != '/') {
+                sb.append('/');
+            }
+            sb.append(localPath);
+            return context.getResponse().encodeURL(sb.toString());
         }
     }
 



Mime
View raw message