abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r520460 - /incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java
Date Tue, 20 Mar 2007 16:17:47 GMT
Author: jmsnell
Date: Tue Mar 20 09:17:46 2007
New Revision: 520460

URL: http://svn.apache.org/viewvc?view=rev&rev=520460
Log:
Go ahead and allow a wider range of characters in the sanitized slug but don't allow a slug
to contain any 
non-encoded URI gendelim characters

Modified:
    incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java

Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java?view=diff&rev=520460&r1=520459&r2=520460
==============================================================================
--- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java
(original)
+++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java
Tue Mar 20 09:17:46 2007
@@ -28,6 +28,7 @@
 import org.apache.abdera.g14n.iri.Escaping;
 import org.apache.abdera.g14n.iri.Constants;
 import org.apache.abdera.g14n.unicode.Normalizer;
+import org.apache.abdera.g14n.ChainableBitSet;
 import org.apache.commons.codec.net.QCodec;
 
 public class EncodingUtil {
@@ -71,9 +72,9 @@
         slug = Escaping.encode(slug, Constants.PATH);
       }
       if (filler != null) {
-        slug = slug.replaceAll("[^A-Za-z0-9\\%]",filler);
+        slug = slug.replaceAll("[^A-Za-z0-9\\%!$&\\\\'()*+,;=]",filler);
       } else { 
-        slug = Escaping.encode(slug, Constants.PATH);
+        slug = Escaping.encode(slug, Constants.PATHNODELIMS);
       }
       return slug;
   }



Mime
View raw message