"Select List" custom field values are not escaped in CDATA in issue XML view, leading to invalid XML

XMLWordPrintable

    • 4.04

      Steps to reproduce:

      1. Take a custom field of type Select List (com.atlassian.jira.plugin.system.customfieldtypes:select).
      2. Add an option to it that is invalid if parsed as XML. Example:
        <FONT COLOR="#009900">Normal</FONT><img src="/images/icons/priority_minor.gif" >
        
      3. Set this option as a value of this custom field to some issue.
      4. Open XML view.

      Observe: XML fails to be parsed, because the generated XML does not escape the option into CDATA section.

      XML looks like

                        <customfield id="customfield_10540" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                          <customfieldname>[cf]Priority</customfieldname>
                          <customfieldvalues>
                            <customfieldvalue key="10560">
                              <FONT COLOR="#009900">Normal</FONT>
                              <img src="/images/icons/priority_minor.gif">
                            </customfieldvalue>
      
                          </customfieldvalues>
                        </customfield>
      

      Expected: custom field value is wrapped into CDATA.

      Note that "Multi Select" and "Multi Checkboxes" custom fields wrap their values into CDATA.

      Reproducible on JIRA 5.0rc1.

            Assignee:
            Unassigned
            Reporter:
            Igor Baltiyskiy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: