[ 
https://issues.apache.org/jira/browse/SLING-8639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christian Schneider updated SLING-8639:
---------------------------------------
    Fix Version/s:     (was: Content Distribution Core 0.4.4)
                   Content Distribution Core 0.4.6

> VltUtils does not escape path in when creating filter patterns
> --------------------------------------------------------------
>
>                 Key: SLING-8639
>                 URL: https://issues.apache.org/jira/browse/SLING-8639
>             Project: Sling
>          Issue Type: Bug
>          Components: Content Distribution
>    Affects Versions: Content Distribution Core 0.4.0
>            Reporter: Timothee Maret
>            Assignee: Christian Schneider
>            Priority: Major
>             Fix For: Content Distribution Core 0.4.6
>
>
> When distributing a deep content path that includes parenthesis using 
> FileVault, the content package produced does not contain content under that 
> path.
> As an example, consider distributing the following path
> {code:java}
> /content/dam/we-retail/planet(1).jpg{code}
> which will yield a content package with the following filter.xml
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <workspaceFilter version="1.0">
>     <filter root="/content/dam/we-retail/planet(1).jpg">
>         <include pattern="/content/dam/we-retail/planet(1).jpg"/>
>         <include pattern="/content/dam/we-retail/planet(1).jpg/.*"/>
>         <exclude pattern="^.*/cq:lastReplicated" matchProperties="true"/>
>         <exclude pattern="^.*/cq:lastReplicatedBy" matchProperties="true"/>
>         <exclude pattern="^.*/cq:lastReplicationAction" 
> matchProperties="true"/>
>     </filter>
> </workspaceFilter>
> {code}
> The include and exclude patterns are treated by FileVault [as regular 
> expression|https://github.com/apache/jackrabbit-filevault/blob/6df76ba4a45316a84ec1cd10636296d191a82260/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/filter/DefaultPathFilter.java#L84].
> Thus the {{(1)}} part of the {{/content/dam/we-retail/planet(1).jpg}} and 
> {{/content/dam/we-retail/planet(1).jpg/.*}} patterns is treated as a group 
> rather than literally.
> The path should be escaped when building the patterns, in 
> https://github.com/apache/sling-org-apache-sling-distribution-core/blob/3d51ac0b09c9a057b590349727392eaedba26aea/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VltUtils.java#L84



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to