Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-1071

Support Manager: Use of substr() does not truncate using multi-byte UTF-8 encoding

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.2.0-b1
    • Component/s: Plugins
    • Labels:
      None

      Description

      Ticket summaries in the admin and client interfaces may not display all characters due to truncation on non-multi-byte UTF-8 characters.

        Issue Links

          Activity

          tyson Tyson Phillips (Inactive) created issue -
          tyson Tyson Phillips (Inactive) made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          tyson Tyson Phillips (Inactive) made changes -
          Summary Support Manager: Ticket summary is not truncating using multi-byte UTF-8 encoding Support Manager: Use of substr() does not truncate using multi-byte UTF-8 encoding
          Hide
          tyson Tyson Phillips (Inactive) added a comment -

          Fixed

          Show
          tyson Tyson Phillips (Inactive) added a comment - Fixed
          tyson Tyson Phillips (Inactive) made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          tyson Tyson Phillips (Inactive) made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          cody Cody Phillips (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          cody Cody Phillips (Inactive) made changes -
          Affects Version/s 3.0.0 [ 10000 ]
          Affects Version/s 3.1.1 [ 10306 ]
          Hide
          cody Cody Phillips (Inactive) added a comment -

          The solution may be some combination of substr, strpos, and wordwrap.

          pseudo code:

          substr($str, 0, strpos(wordwrap($str, 40), "\n"))

          That is, break on word, and cut on new line.

          Show
          cody Cody Phillips (Inactive) added a comment - The solution may be some combination of substr, strpos, and wordwrap. pseudo code: substr($str, 0, strpos(wordwrap($str, 40), "\n")) That is, break on word, and cut on new line.
          Hide
          tyson Tyson Phillips (Inactive) added a comment -

          The current substr() usage on multibype characters causes tickets to not be refreshed via AJAX due to the json encoding. Need to test this with Cody's fix

          Show
          tyson Tyson Phillips (Inactive) added a comment - The current substr() usage on multibype characters causes tickets to not be refreshed via AJAX due to the json encoding. Need to test this with Cody's fix
          Hide
          tyson Tyson Phillips (Inactive) added a comment - - edited

          The following will not fix the issue because it breaks on the last space character:
          $summary = substr($summary, 0, strpos(wordwrap($summary, 40, "\n"), " ")) . "...";

          Note that the support manager ticket listing may experience this issue and cause the page to fail to load via AJAX. A related solution would be necessary.

          Show
          tyson Tyson Phillips (Inactive) added a comment - - edited The following will not fix the issue because it breaks on the last space character: $summary = substr($summary, 0, strpos(wordwrap($summary, 40, "\n"), " ")) . "..."; Note that the support manager ticket listing may experience this issue and cause the page to fail to load via AJAX. A related solution would be necessary.
          admin Paul Phillips made changes -
          Fix Version/s 3.1.3 [ 10405 ]
          Fix Version/s 3.1.2 [ 10403 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.1.4 [ 10500 ]
          Fix Version/s 3.1.3 [ 10405 ]
          Hide
          tyson Tyson Phillips (Inactive) added a comment -

          This fix depends on the completion of CORE-1137.

          Show
          tyson Tyson Phillips (Inactive) added a comment - This fix depends on the completion of CORE-1137 .
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue is blocked by CORE-1137 [ CORE-1137 ]
          tyson Tyson Phillips (Inactive) made changes -
          Fix Version/s 3.1.4 [ 10500 ]
          tyson Tyson Phillips (Inactive) made changes -
          Status Reopened [ 4 ] In Progress [ 3 ]
          Hide
          tyson Tyson Phillips (Inactive) added a comment -

          This will now truncate based on the number of words.

          Show
          tyson Tyson Phillips (Inactive) added a comment - This will now truncate based on the number of words.
          tyson Tyson Phillips (Inactive) made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          tyson Tyson Phillips (Inactive) made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          cody Cody Phillips (Inactive) added a comment -

          Tyson Phillips Can this be updated such that we're not creating the DataStructureString object in the view, but instead pass that object to the view from the controller via set()?

          Show
          cody Cody Phillips (Inactive) added a comment - Tyson Phillips Can this be updated such that we're not creating the DataStructureString object in the view, but instead pass that object to the view from the controller via set()?
          Hide
          tyson Tyson Phillips (Inactive) added a comment -

          Done

          Show
          tyson Tyson Phillips (Inactive) added a comment - Done

            People

            • Assignee:
              tyson Tyson Phillips (Inactive)
              Reporter:
              tyson Tyson Phillips (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                23/Apr/14