Uploaded image for project: 'Magnolia REST Framework'
  1. Magnolia REST Framework
  2. MGNLREST-125

Parameter of filtering/searching should be sql2 encoded

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 2.0
    • None
    • None
    • None

    Description

      If I pass a part of query in parameter such as ?mgnl:template=travel-demo:pages/a' or [mgnl:template]='travel-demo:pages/home' and [mgnl:template]='travel-demo:pages/home in filtering endpoint, the query string is generated property. So the parameter should be encoded in filtering/searching. Notice the (single quote)

      In log:
      INFO  info.magnolia.rest.delivery.jcr.QueryBuilder      : SQL statement is SELECT t.* FROM [nt:base] AS t WHERE (t.[jcr:primaryType] = 'mgnl:page' OR t.[jcr:primaryType] = 'mgnl:area' OR t.[jcr:primaryType] = 'mgnl:component') AND (t.[mgnl:template] = 'travel-demo:pages/a' OR t.[mgnl:template] = 'travel-demo:pages/home' AND t.[mgnl:template] = 'travel-demo:pages/home') ORDER BY LOWER(NAME(t))
      

      Sample URL:
      http://localhost:8080/magnoliaAuthor/.rest/delivery/website/v1?mgnl:template=travel-demo:pages/a%27%20or%20[mgnl:template]=%27travel-demo:pages/home%27%20and%20[mgnl:template]=%27travel-demo:pages/home

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              hieu.nguyen Hieu Nguyen Duc
              sang.ngo Sang Ngo Huu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD

                  Time Tracking

                    Estimated:
                    Original Estimate - 2d Original Estimate - 2d
                    2d
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 3d 1.5h
                    3d 1.5h