Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-1021

Fix initialization bug and add size parameter to form-property

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Nightly Build
    • Fix Version/s: 1.1 Family
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other
    • Bugzilla Id:
      14800

      Description

      The logic for getting an initial value for a form-property was flawed, in this
      sense: If the initial value was a array, the initial() call would clone the
      array but not the values in the array, meaning that all copies of the form
      that used this property would share the same objects. This is a MAJOR
      security hole, as it means that people can end up seeing other people's credit
      card numbers, etc.

      I've changed it to always compute the initial value again, rather than trying
      to cache it. I've also removed the now-unused "initialized" property.

      This patch also adds a form-property parameter called size. If it is
      specified, the type must specify an array. It causes the property value to be
      initialized to an array of the appropriate size, with newly instantiated
      copies of the appropriate object type.

      The addition of "size" has been "Official Approved by Craig", for what that's
      worth, in that we talked about it at ApacheCon and he agreed it should be
      added.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              blackbear James Turner
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: