ICEfaces
  1. ICEfaces
  2. ICE-11494

ice:outputResource fails when resource name contains illegal URL characters

    Details

      Description

      A syntax error is produced when a resource served by these components contains illegal URL characters. All illegal URL characters should be encoded.

        Activity

        Hide
        Arturo Zambrano added a comment - - edited

        r53224: ICE-11494 added functions to efficiently encode special characters in the file name portion of the resource path, so that resources that contain special characters can be downloaded (to the EE 3.3 maintenance branch)

        Because of the reasons described in ICE-11484, it wasn't possible to apply the encoding only to the file name, before it was registered. Trying to do this from the component class resulted in including the % encoding characters in the downloaded filename, because that's how the resource was registered on the framework. So, this solution takes the resource path and extracts the filename portion and escapes all special characters, and inserts it back in the resource path, replacing the old file name, in order to form a valid URL.

        Note that while all special characters are correctly escaped now, some special characters may be illegal in some operating systems, which results in the OS replacing those special characters for a safe characters. For example, on Windows, all these characters / \ " * : < > ? | ~ are replaced by underscores when saved to the file system.

        Show
        Arturo Zambrano added a comment - - edited r53224: ICE-11494 added functions to efficiently encode special characters in the file name portion of the resource path, so that resources that contain special characters can be downloaded (to the EE 3.3 maintenance branch) Because of the reasons described in ICE-11484 , it wasn't possible to apply the encoding only to the file name, before it was registered. Trying to do this from the component class resulted in including the % encoding characters in the downloaded filename, because that's how the resource was registered on the framework. So, this solution takes the resource path and extracts the filename portion and escapes all special characters, and inserts it back in the resource path, replacing the old file name, in order to form a valid URL. Note that while all special characters are correctly escaped now, some special characters may be illegal in some operating systems, which results in the OS replacing those special characters for a safe characters. For example, on Windows, all these characters / \ " * : < > ? | ~ are replaced by underscores when saved to the file system.
        Hide
        Arturo Zambrano added a comment -

        This issue is actually not present in ace:dynamicResource, because it uses a different mechanism to serve resources.

        Show
        Arturo Zambrano added a comment - This issue is actually not present in ace:dynamicResource, because it uses a different mechanism to serve resources.
        Hide
        Arturo Zambrano added a comment -

        r53237: added code to avoid NPE's when the resource has no filename specified

        Show
        Arturo Zambrano added a comment - r53237: added code to avoid NPE's when the resource has no filename specified
        Hide
        Arturo Zambrano added a comment - - edited

        r53334, r53335: A reworked fix to support escaping of spaces, special characters, and foreign/UTF-8 characters in ice:outputResource and ace:dynamicResource (EE 3.3 maintenance branch and P08 tag)

        Show
        Arturo Zambrano added a comment - - edited r53334, r53335: A reworked fix to support escaping of spaces, special characters, and foreign/UTF-8 characters in ice:outputResource and ace:dynamicResource (EE 3.3 maintenance branch and P08 tag)

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arturo Zambrano
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: