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

        Emmanuel Bourg created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 30212 12341585
        Henri Yandell made changes -
        Key COM-1433 CONFIGURATION-32
        Project Commons [ 12310458 ] Commons Configuration [ 12310467 ]
        Affects Version/s Nightly Builds [ 12311648 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s Configuration [ 12311107 ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311710 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development