Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-45872

Rest api doesn't work when page title starts with a number

    XMLWordPrintable

Details

    Description

      Summary

      Rest api call doesn't work correctly when the page title starts with numbers

      Environment

      Confluence 5.10.8

      Steps to Reproduce

      1. Create a page and name it "test"
      2. Run this call:
         curl -u admin:admin -s -n http://localhost:8090/rest/api/content/search?cql=title=test | python -mjson.tool
      3. Call returns correct result
      4. Now create a page and call 100test
      5. Run this call:
         curl -u admin:admin -s -n http://localhost:8090/rest/api/content/search?cql=title=100test | python -mjson.tool

      Expected Results

      You should get a result of the search since the page exist.

      Actual Results

      You get a 400 error like the following

      {
          "data": {
              "authorized": false,
              "errors": [],
              "notSuccessful": true,
              "successful": false,
              "valid": true
          },
          "message": "Unrecognised clause at : test",
          "statusCode": 400
      }
      

      Workaround

      Encode the " when running the query to look like this

      curl -u admin:admin -s -n http://localhost:8090/rest/api/content/search?cql=title=%22100test%22 | python -mjson.tool
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            oraissi Omar Raissi
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: