Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10201

Stapler automatically wraps braces in quotes, but does not reverse the quotes on Java side

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      A f:textbox input where the user enters a string that both starts and ends with curly braces (e.g., "

      {foo}

      ") has its value wrapped in double quotes by the stapler JSON encoder (presumably to distinguish the "

      {..}

      " string from a JSON object). However, the double-quotes do not get stripped on the other side. Example:

          @DataBoundConstructor
          public SomeClass(final String input) {
              LOGGER.log(Level.FINEST, "Received input: " + input);
              this.input = input;
          }
      

      results in the following test results (" – input" represents the literal that was entered into the field):

        -- input = X\{foo\}X
      FINEST: Received input: X\{foo\}X
      
        -- input = \{foo\}X
      FINEST: Received input: \{foo\}X
      
        -- input = X\{foo\}
      FINEST: Received input: X\{foo\}
      
        -- input = \{foo\}
      FINEST: Received input: "\{foo\}"
      
        -- input = \{foo\}\{bar\}
      FINEST: Received input: "\{foo\}\{bar\}"

      The last 2 entries do not have the double quotes stripped from the input. Once the string is received by Stapler, it should be able to decode the string to recover what the user initially entered in the field.

        Attachments

          Issue Links

            Activity

            Hide
            jhansche Joe Hansche added a comment - - edited

            Meh.. that change was not a fix for this issue, only indicating that it works around the issue (by stripping the quotes in the DataBoundConstructor) -_-

            Show
            jhansche Joe Hansche added a comment - - edited Meh.. that change was not a fix for this issue, only indicating that it works around the issue (by stripping the quotes in the DataBoundConstructor) -_-
            Hide
            bap bap added a comment -

            Square brackets have the same issue, i.e. [abc] -> "[abc]"

            Show
            bap bap added a comment - Square brackets have the same issue, i.e. [abc] -> " [abc] "
            Hide
            cypromis cypromis added a comment -

            This especially suxx if you use ipv6 addresses that need to be put into square brackets. You insert them in the main config, try TEST YAY! all fine. You save the data and nothing works.

            Show
            cypromis cypromis added a comment - This especially suxx if you use ipv6 addresses that need to be put into square brackets. You insert them in the main config, try TEST YAY! all fine. You save the data and nothing works.
            Hide
            voorth voorth added a comment -

            I ran into this problem when trying to input an svn revision range with dates:

            {2011-10-24}

            :

            {2011-10-29}

            will be enquoted.

            unfortunately, svn does not handle quoted ranges well if both are dates...

            Show
            voorth voorth added a comment - I ran into this problem when trying to input an svn revision range with dates: {2011-10-24} : {2011-10-29} will be enquoted. unfortunately, svn does not handle quoted ranges well if both are dates...
            Hide
            danielbeck Daniel Beck added a comment -

            Fixed in 1.506 (JENKINS-14827)

            Show
            danielbeck Daniel Beck added a comment - Fixed in 1.506 ( JENKINS-14827 )

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jhansche Joe Hansche
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: