Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-31718

shorten_text is not UTF8 safe

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.16, 2.0.7, 2.1.4, 2.2.1
    • Fix Version/s: 2.2.3
    • Component/s: General
    • Labels:

      Description

      The global function shorten_text should be UTF8 safe

      Currently it uses strlen and substr for perform strings operations over UTF8 text

      This may cause some problems and wrong results

      I.e:

      shorten_text($text, 34) function for the following texts:

      Mañana leña cigüeña camión pequeño returns Mañana leña cigüeña ...
      Manana lena ciguena camion pequeno returns Manana lena ciguena camion pequeno

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              jleyva Juan Leyva
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Sam Hemelryk
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/May/12