Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-32

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

    Details

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

      Operating System: All
      Platform: All

      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>

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development