-
Improvement
-
Resolution: Fixed
-
Minor
-
4.4
-
MOODLE_404_STABLE
-
MOODLE_404_STABLE
-
MDL-80072-main -
This issue covers migrating the existing format functions into a new class for calling.
One of the issues we currently face is that we have a combination of uses of both:
- format_string; and
- external_format_string.
The main difference between these is that:
- for format_string filters are enabled by default
- for external_format_string filters are disabled by default.
This sounds easy at a first glance until you consider the fact that many WS call standard libraries whichi use the standard format_string method rather than the external_format_string method, which can lead to partially-filtered content.
This issue is looking to add a new class, \core\formatting, and migrate the content of the existing format_string, format_text, and any other related methods there.
Further to that I'm looking into the feasability of adding a set of static methods for:
- enable_filters(): void
- disable_filters(): void
- filters_enabled(): bool
The intent being that rather than the external_format_stirng method disabling filters by default, we disable them in the web service chain - that is, in an earlier part of the API.
For the new WS framework we are implementing the intent is to support enabling/disabling filters by setting an appropriate request header, similar to how a client may specify the Accept (HTTP_ACCEPT) (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept header to a value such as application/json. For example FilterContent with a boolean-like value. This will allow the client to decide whether content is filtered (note, the actual filters which are applied will not change).
Ideally we should also allow provision of fields required to rewrite pluginfile URLs and allow format_text to have the same API for both web and external usage.
- blocks
-
MDL-80838 Add support for PSR-20 (Clock) to allow better time management
-
- Closed
-
-
MDL-80536 Update \core_external to use \core\formatting
-
- Open
-
-
MDL-80438 Consider adding Laravel-like Facades to core
-
- Closed
-
- caused a regression
-
MDL-81413 Exception being thrown when sending messages on chat module
-
- Closed
-
-
MDL-81574 Exception being thrown when exporting forum posts
-
- Closed
-
-
MDL-81577 String formatting errors when exporting module RSS feeds
-
- Closed
-
-
MDL-82323 During install error handling contains error in get_striptags()
-
- Closed
-
- has a non-specific relationship to
-
MDL-80349 Policy: Ban the use of $options arrays, and similar loosely-typed arguments to methods
-
- Open
-
- has been marked as being related by
-
MDL-82530 Spelling: "Unkown format passed to format_text"
-
- Closed
-
- has to be done before
-
MDL-81134 Remove upgrade critical requires
-
- Open
-
-
MDL-80536 Update \core_external to use \core\formatting
-
- Open
-
- is blocked by
-
MDL-80079 format_string called with context instead of an array with a context
-
- Closed
-
- Testing discovered
-
MDL-80441 Remove version number checks in format_*
-
- Open
-
- will help resolve
-
MDL-80073 Add DI to Moodle
-
- Closed
-
- links to