You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2008/12/18 16:48:54 UTC

svn commit: r727753 - /incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java

Author: fmeschbe
Date: Thu Dec 18 07:48:54 2008
New Revision: 727753

URL: http://svn.apache.org/viewvc?rev=727753&view=rev
Log:
SLING-787 Ensure MapEntry patterns are matched only at the beginning of the string

Modified:
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java?rev=727753&r1=727752&r2=727753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java (original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java Thu Dec 18 07:48:54 2008
@@ -183,6 +183,11 @@
             }
         }
 
+        // ensure pattern is hooked to the start of the string
+        if (!url.startsWith("^")) {
+            url = "^".concat(url);
+        }
+        
         this.urlPattern = Pattern.compile(url);
         this.redirect = redirect;
         this.status = status;