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

Cache of function format_text works not properly with input in wrong encoding


    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.13
    • Fix Version/s: None
    • Component/s: General
    • Labels:
    • Affected Branches:


      Some special chars in text are interpreted as MySQL escape-chars, when in wrong encoding. Saving this text in the cache_text table by the function format_string is not working and leads to shortened text. Using that cached text for display leads to display errors (due some div-container are missing) and, of course, missing text.

      We found that bug after using the wiki module. When opening in a course without "page" parameter the funktion format_text will be used. In our case, we found that bug using "Ü". First it displayed all text. After refreshing (when it was using the cached text) the text was missing and div-container where totally messed up.

      We fixed that problem by base64 encode before inserting (insert_record, update_record in function format_text in the weblib.php) in db and decode before the return of the string. Another solution would be disabling the caching, but due we have a huge amount of users (30.000+), we aren't sure, if that will cost much performance.

      Maybe there's another solution, which isn't as dirty as the encoding, but hasn't such an effect on the performance.

        Gliffy Diagrams




              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: