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

format_string doesn't use filter in static cache key

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.3, 3.4
    • 3.3.4, 3.4.1
    • Filters

    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

            ryanwyllie Ryan Wyllie
            ryanwyllie Ryan Wyllie
            Luca Bösch Luca Bösch
            David Monllaó David Monllaó
            CiBoT CiBoT
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/Jan/18