Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-32

[configuration] XMLConfiguration.save() doesn't escape reserved characters

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      30212

      Description

      If an XML configuration contains a property with a '<' character or an attribute
      property with a quote '"', the value is not properly escaped with < or "
      in the saved configuration, resulting in an error the next time the
      configuration is loaded.

      For example:
      conf.setProperty("foo", "1<2");
      conf.setProperty("foo[@bar]", "1\"2");
      conf.save();

      will generate the following file:

      <configuration>
      <foo bar="1"2">1<2</foo>
      <configuration>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ebourg Emmanuel Bourg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: