Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-27360

The remove template operator won't work with UTF8 characters

    Details

      Description

      Since the remove template operator is based on the PHP function substr, which cannot handle utf8 strings, the operator will return weird � characters if used with special chars.

      Please check custom proposed fix:
      https://github.com/mugoweb/ezpublish-legacy/pull/57 Edit: Now https://github.com/ezsystems/ezpublish-legacy/pull/1298

      Steps to reproduce.
      • Edit a legacy tpl template, and add the following code to it:

        {'fipsï'|remove( 4,1 )}

      • Clear the caches, and open the respective content in the frontend
      • Confirm the code will return �, instead ï

        Activity

        Eduardo Fernandes (Inactive) created issue -
        Eduardo Fernandes (Inactive) made changes -
        Field Original Value New Value
        Link This issue relates to CS-6191 [ CS-6191 ]
        Eduardo Fernandes (Inactive) made changes -
        Status Open [ 1 ] Confirmed [ 10037 ]
        Eduardo Fernandes (Inactive) made changes -
        Status Confirmed [ 10037 ] InputQ [ 10001 ]
        Gunnstein Lye made changes -
        Assignee Gunnstein Lye [ gunnstein.lye@ez.no ]
        Gunnstein Lye made changes -
        Status InputQ [ 10001 ] Development [ 3 ]
        Gunnstein Lye made changes -
        Status Development [ 3 ] Development Review [ 10006 ]
        Gunnstein Lye made changes -
        Description Since the remove template operator is based on the PHP function substr, which cannot handle utf8 strings, the operator will return weird � characters if used with special chars.

        Please check custom proposed fix:
        https://github.com/mugoweb/ezpublish-legacy/pull/57

        h6. Steps to reproduce.

        - Edit a legacy tpl template, and add the following code to it:
        {code}{'fipsï'|remove( 4,1 )}{code}
        - Clear the caches, and open the respective content in the frontend
        - Confirm the code will return �, instead ï
        Since the remove template operator is based on the PHP function substr, which cannot handle utf8 strings, the operator will return weird � characters if used with special chars.

        Please check custom proposed fix:
        https://github.com/mugoweb/ezpublish-legacy/pull/57 Edit: Now https://github.com/ezsystems/ezpublish-legacy/pull/1298

        h6. Steps to reproduce.

        - Edit a legacy tpl template, and add the following code to it:
        {code}{'fipsï'|remove( 4,1 )}{code}
        - Clear the caches, and open the respective content in the frontend
        - Confirm the code will return �, instead ï
        Gunnstein Lye made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 30 minutes [ 1800 ]
        Worklog Id 64094 [ 64094 ]
        Gunnstein Lye made changes -
        Status Development Review [ 10006 ] Documentation Review done [ 10011 ]
        Affects Version/s 5.3.11 [ 14610 ]
        Assignee Gunnstein Lye [ gunnstein.lye@ez.no ]
        Rui Silva (Inactive) made changes -
        Status Documentation Review done [ 10011 ] QA [ 10008 ]
        Rui Silva (Inactive) made changes -
        Status QA [ 10008 ] InputQ [ 10001 ]
        Assignee Rui Silva [ rui.silva@ez.no ]
        Gunnstein Lye made changes -
        Fix Version/s 5.3.12 [ 14639 ]
        Fix Version/s 5.4.10 [ 14640 ]
        Gunnstein Lye made changes -
        Status InputQ [ 10001 ] Development [ 3 ]
        Assignee Gunnstein Lye [ gunnstein.lye@ez.no ]
        Gunnstein Lye made changes -
        Status Development [ 3 ] Development Review [ 10006 ]
        Gunnstein Lye made changes -
        Status Development Review [ 10006 ] Documentation Review done [ 10011 ]
        Assignee Gunnstein Lye [ gunnstein.lye@ez.no ]
        Gunnstein Lye made changes -
        Time Spent 30 minutes [ 1800 ] 1 hour [ 3600 ]
        Worklog Id 64445 [ 64445 ]
        Rui Silva (Inactive) made changes -
        Status Documentation Review done [ 10011 ] QA [ 10008 ]
        Rui Silva (Inactive) made changes -
        Assignee Rui Silva [ rui.silva@ez.no ]
        Status QA [ 10008 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Alex Schuster made changes -
        Workflow EZ* Development Workflow [ 103837 ] EZEE Development Workflow [ 126485 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Eduardo Fernandes (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour
              1h