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

        Hide
        Gunnstein Lye added a comment -

        PR by pkamps: https://github.com/ezsystems/ezpublish-legacy/pull/1298

        (See also older PR by brookinsconsulting which autodetects presence of mb_ functions: https://github.com/ezsystems/ezpublish-legacy/pull/1162 This should not be needed as mbstring is a requirement.)

        Show
        Gunnstein Lye added a comment - PR by pkamps: https://github.com/ezsystems/ezpublish-legacy/pull/1298 (See also older PR by brookinsconsulting which autodetects presence of mb_ functions: https://github.com/ezsystems/ezpublish-legacy/pull/1162 This should not be needed as mbstring is a requirement.)
        Hide
        Rui Silva (Inactive) added a comment -

        Tested and approved by QA for 5.4.
        As per Gunnstein Lye's request, this was also tested on a 5.3 and it also solves the issue.

        Show
        Rui Silva (Inactive) added a comment - Tested and approved by QA for 5.4. As per Gunnstein Lye 's request, this was also tested on a 5.3 and it also solves the issue.
        Hide
        Rui Silva (Inactive) added a comment -

        Sending back to dev-needed so that PR can be merged.
        Please send back to QA afterwards so that QA can inform Support Team that a fix is ready for the customer.
        Thank you.

        Show
        Rui Silva (Inactive) added a comment - Sending back to dev-needed so that PR can be merged. Please send back to QA afterwards so that QA can inform Support Team that a fix is ready for the customer. Thank you.
        Show
        Gunnstein Lye added a comment - Merged in master: https://github.com/ezsystems/ezpublish-legacy/commit/154214ef06442ede74ca2ab1a4aa9ea14630861e

          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