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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Nightly Builds
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 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

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

            Dates

              Created:
              Updated:
              Resolved: