wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r813038 - /incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java
Date Wed, 09 Sep 2009 16:28:07 GMT
Author: bluk
Date: Wed Sep  9 16:28:06 2009
New Revision: 813038

URL: http://svn.apache.org/viewvc?rev=813038&view=rev
Log:
Skip path normalization if there are no evil paths

See [WINK-173]

Modified:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java?rev=813038&r1=813037&r2=813038&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java
Wed Sep  9 16:28:06 2009
@@ -41,6 +41,10 @@
      * @return normalize path
      */
     public static String normalize(String path) {
+        if ((path != null) && (path.indexOf(".") == -1) && (path.indexOf("//")
== -1)) {
+            return path;
+        }
+
         boolean wasNormalized = true;
 
         // 1. count number of nonempty segments in path
@@ -55,7 +59,7 @@
                 // empty segment? (two adjacent slashes?)
                 if (slash == src) {
                     if (src != lastChar) { // ignore the first slash occurence
-                                           // (when numSegments == 0)
+                        // (when numSegments == 0)
                         wasNormalized = false;
                     }
                 } else {



Mime
View raw message