Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4638

Inputs submitted by AJAX loose all content beginning with ampersand ("&") characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0, 5.0.0
    • 4.0.2, 4.1.0-RC1, 5.0.0
    • None
    • None

    Description

      When submitting input fields with AJAX the ampersand "&" character is not handled properly on client side.

      A test case ist attached. Just submitting the form works as expected, submitting by AJAX
      fails if input contains "&"-signs, like "foo&bar".

      It tracked this down to the function decodeEncodedValues in FileUtils.ts. There happens a
      decode of the current ViewState in URI-encoded format.

      Basically the source of the issue is that the input string (in "encoded") is processed in wrong order.
      Currently it is first URI-decoded an then splitted by ampersands ("&"). It has to be in
      reverse order, since the payload may contain ampersands, which are URI-encoded by "%26".

      A small working patch for demonstration is attached.

      Attachments

        1. patch-FileUtils.txt
          1 kB
          Andreas Osterburg
        2. test.xhtml
          0.6 kB
          Andreas Osterburg

        Activity

          People

            werpu Werner Punz
            andreas.osterburg@digide.net Andreas Osterburg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: