roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r432329 - /incubator/roller/branches/roller_3.0/src/org/apache/roller/util/URLUtilities.java
Date Thu, 17 Aug 2006 18:43:46 GMT
Author: agilliland
Date: Thu Aug 17 11:43:45 2006
New Revision: 432329

URL: http://svn.apache.org/viewvc?rev=432329&view=rev
Log:
for category permalinks we need to url encode the category twice to ensure that it works properly.
 this is because the url path is automatically url decoded before it can be accessed by the
request object, and thus if a decoded category url has a character like a "?" then it will
break.  double encoding fixes this problem and works fine because the url is first decoded
by the container, then we decode it once more ourselves.


Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/util/URLUtilities.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/util/URLUtilities.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/util/URLUtilities.java?rev=432329&r1=432328&r2=432329&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/util/URLUtilities.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/util/URLUtilities.java Thu
Aug 17 11:43:45 2006
@@ -160,7 +160,9 @@
         }
         
         if(cat != null && dateString == null) {
-            pathinfo.append("category/").append(encode(cat));   
+            // yes, for the path based versions we double encode the category
+            // because otherwise some characters cause problems, like "?"
+            pathinfo.append("category/").append(encode(encode(cat)));   
             
         } else if(dateString != null && cat == null) {
             pathinfo.append("date/").append(dateString);  



Mime
View raw message