Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-1912

POST data submitted to the site should be encoded before being sent to the CMS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • 3.1
    • 3.0RC1
    • Workspace : Site
    • None

      As of 3.0RC3, when a POST form is submitted to the site, the POST data is sent to the CMS without being encoded.
      I got this error submitting data through a CMS form containing a textarea and a file input (created with the Forms plugin). Here, the line breaks seem to be responsible for the bug.

      java.net.URISyntaxException: Illegal character in query at index 220: http://inpt-cms.laureline:8080/inpt-cms/generate/plugins/forms/submit?_contextPath=&defaultWebContent://b3a1ce13-74f8-4eb0-a605-313bdfdc379d%20form-ametys-08430425153157507%20ametys-gen-10=mvpyjr&radio1=a&textarea1=texte
      texte
      texte
      &password1=password&select1=Valeur 2&submit1=Valider&ametys-form-id=form-ametys-08430425153157507&email=test@mail.com&hidden=hiddenValue&text1=texte&file1=/home/cms/site/web/WEB-INF/data/uploads/test document.odt&ametys-content-id=defaultWebContent://b3a1ce13-74f8-4eb0-a605-313bdfdc379d
      	at java.net.URI$Parser.fail(URI.java:2809)
      	at java.net.URI$Parser.checkChars(URI.java:2982)
      	at java.net.URI$Parser.parseHierarchical(URI.java:3072)
      	at java.net.URI$Parser.parse(URI.java:3014)
      	at java.net.URI.<init>(URI.java:578)
      	at java.net.URI.create(URI.java:840)
      	at org.apache.http.client.methods.HttpPost.<init>(HttpPost.java:76)
      	at org.ametys.web.site.GeneratePageAction.act(GeneratePageAction.java:80)
              [...]
      

      Spec for form data : http://www.w3.org/TR/html4/interact/forms.html#h-17.13.3 (§17.13.3 and §17.13.4).

      Moreover, the file input is sent as text because the form enctype property (here, set to "multipart/form-data") is not taken into account.

            Unassigned Unassigned
            ngavalda Nicolas Gavalda (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: