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

object name limit does not support multibyte charset

    Details

      Description

      how to reproduce:

      • change ini setting to allow object names to go to 255 chars
      • create a folder with a name longer than 255 UNICODE wide chars (eg. japanese)
      • the object name gets truncated at a length below 255

      reason:

      • the code generating object names cuts the string using a simple strlen() call, without using proper unicode-aware functions.

      Otoh the code used f.e. to limit length of string datatype, uses eztextcodec to do proper utf8-aware length checks.

        Issue Links

          Activity

          Hide
          André Rømcke added a comment -

          PR: https://github.com/ezsystems/ezpublish-legacy/pull/715

          Eduardo: Please check the unit test to comment on if this is expected behavior with the strings you provided.

          Show
          André Rømcke added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/715 Eduardo: Please check the unit test to comment on if this is expected behavior with the strings you provided.
          Show
          André Rømcke added a comment - Merged in: https://github.com/ezsystems/ezpublish-legacy/commit/5f7afe345da99670dea0e21ca0f6c6485cfdde66
          Hide
          Gaetano Giunta (Inactive) added a comment -

          Seems like the fix is good but incomplete.

          As Pedro said, we now get the correct length for object name - but not for sort_key_string.
          That col is truncated by ezpersistentobject::storeObject(), using non-utf8-aware code.
          1 - it gets shorter comparison keys than needed
          2 - the last char in the sort_key_string might become an invalid utf8 char

          Show
          Gaetano Giunta (Inactive) added a comment - Seems like the fix is good but incomplete. As Pedro said, we now get the correct length for object name - but not for sort_key_string. That col is truncated by ezpersistentobject::storeObject(), using non-utf8-aware code. 1 - it gets shorter comparison keys than needed 2 - the last char in the sort_key_string might become an invalid utf8 char
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA.

            People

            • Assignee:
              Unassigned
              Reporter:
              Eduardo Fernandes (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              8 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 day, 1 hour, 28 minutes
                1d 1h 28m