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

format_string doesn't use filter in static cache key

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.3, 3.4
    • Fix Version/s: 3.3.4, 3.4.1
    • Component/s: Filters
    • Labels:

      Description

      The format_string function in lib/weblib.php caches the strings in a static variable however the key it generates for the cache doesn't include the 'filter' option which means that a request to format a string with filters won't actually apply the filters if format_string has already been called on that string without filters.

      E.g.
      format_string('some string', true, ['context' => 1, 'filter' => false]);
      and
      format_string('some string', true, ['context' => 1, 'filter' => true]);
      produce the same result, even though the second call requests that the filters apply.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jan/18