You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by tm...@apache.org on 2021/01/31 02:44:10 UTC

[sling-org-apache-sling-distribution-core] branch SLING-10088-fix created (now 1c7560c)

This is an automated email from the ASF dual-hosted git repository.

tmaret pushed a change to branch SLING-10088-fix
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-core.git.


      at 1c7560c  SLING-10088 - do not escape the root slash

This branch includes the following new commits:

     new 1c7560c  SLING-10088 - do not escape the root slash

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-distribution-core] 01/01: SLING-10088 - do not escape the root slash

Posted by tm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tmaret pushed a commit to branch SLING-10088-fix
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-core.git

commit 1c7560cf5b88b9c7a1f8b024832b88cdfd201873
Author: tmaret <tm...@adobe.com>
AuthorDate: Sun Jan 31 03:43:21 2021 +0100

    SLING-10088 - do not escape the root slash
---
 .../distribution/serialization/impl/vlt/VltUtils.java | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VltUtils.java b/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VltUtils.java
index 0586cfc..b18e62d 100644
--- a/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VltUtils.java
+++ b/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VltUtils.java
@@ -90,7 +90,7 @@ public class VltUtils {
             boolean deep = distributionRequest.isDeep(path);
             PathFilterSet nodeFilterSet = new PathFilterSet(path);
             if (!deep) {
-                nodeFilterSet.addInclude(new DefaultPathFilter(Pattern.quote(path)));
+                nodeFilterSet.addInclude(new DefaultPathFilter(quote(path)));
             }
             initFilterSet(nodeFilterSet, nodeFilters, patterns);
 
@@ -101,6 +101,8 @@ public class VltUtils {
             filter.add(nodeFilterSet, propertyFilterSet);
         }
 
+        log.info("filter: {}", filter);
+
         return filter;
     }
 
@@ -447,4 +449,19 @@ public class VltUtils {
 
         return result;
     }
+
+    private static String quote(String path) {
+
+        // See SLING-10088, JCRVLT-500
+
+        if (path == null) {
+            return null;
+        } else if (path.startsWith("/")) {
+            return "/" + Pattern.quote(path.substring(1));
+        } else {
+            return Pattern.quote(path);
+        }
+
+    }
+
 }