Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7516

ResourceRuntimeExtension: Selectors containing a comma are not treated correctly

    XMLWordPrintableJSON

Details

    Description

      Due to the way how the request dispatcher options are serialized into one big string in https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/cd7d67e66f624c66fe88dd208c4d2b8f7e85c8ec/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java#L214 you cannot use e.g. selectors which contain a comma. This is a problem because currently selectors are the only way to propagate parameters from one HTL script to another script/servlet (compare with SLING-7515).

      The method createDispatcherOptions generates a String from a Map where the entries are separated by , i.e. comma. If either the map key or the map value contain a comma itself the tokenization in https://github.com/apache/sling-org-apache-sling-api/blob/ec3dcf291b26e833b07a1f9c485bbe713a7ad4d5/src/main/java/org/apache/sling/api/request/RequestDispatcherOptions.java#L100 works incorrectly!

      Therefore instead of using the constructor with a string (with very simple/incorrect parsing) the RequestDispatcherOptions should rather be created with an empty string and then the map should be filled with the according put/set methods.

      Attachments

        Issue Links

          Activity

            People

              radu Radu Cotescu
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: