Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4848

The if test can accidently incorrectly assign a new value to an object

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.5.13
    • 2.5.14
    • None
    • None

    Description

      The s:if tag has the side effect of assigning to an existing object
      if the comparison is badly formed using = instead of ==

      <s:if test="user.id = 0">  
        //at this point the user.id is now 0 not its original value
      </s:if>
      

      even though this is clearly badly formed, the test should not assign anything to the object

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            alancomeau Alan Comeau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment