Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-4645

When editing a property of type "TEXT", the text area that displays its value encodes it twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Web
    • Labels:
      None

      Description

      To reproduce:

      • Go to a Java profile
      • Make a copy of the XPath rule, with xpathQuery set to ">"
      • See this new rule on the profile => it's OK
      • Click "Edit rule" on this new rule => the text area for xpathQuery show the encoded version of '>' (so "&gt").

      The explanation is that in edit.html.erb, the value passed to the "param_value_input" helper is encoded: {{"#

      {h parameter.default_value}

      "}}
      But the "param_value_input" helper is based on "properties_helper" which relies on Rails "text_area_tag" for "TEXT" properties, and this "text_area_tag" encodes the value that must be displayed. That's why the value is encoded twice.

      There's no problem with XPath rules of some other plugins (like Javascript) because this xpathQuery is set as "STRING" and not "TEXT", so it is displayed in a text field which is rendered by Rails "text_field_tag" that does not encode the given value...

        Attachments

        1. Value.png
          60 kB
          OLD - Fabrice Bellingard

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              fabemn OLD - Fabrice Bellingard
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: