Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.3.3, 3.4
-
Component/s: Filters
-
Testing Instructions:
-
Affected Branches:MOODLE_33_STABLE, MOODLE_34_STABLE
-
Fixed Branches:MOODLE_33_STABLE, MOODLE_34_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-60942-master -
Pull Master Diff URL:
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.