The new configuration flag $CFG->forceclean overrides the noclean
option when calling format_text() so that the text is always
and unconditionally cleaned.
The mtrace function is preferable for plain text logging/progress
output because it can be redirected if necessary. By convention it
is normally used in cron and can be used in CLI tasks if required.
This change makes the text_progress_trace class use mtrace instead
of echo and then flush. (Default behaviour of mtrace is to do
exactly that, but it can be redirected too.)
Before this change, if anybody is relying on mtrace behaviour to
redirect logs of cron output, this will fail for some parts of the
search cron output (and some other places like auth plugins).
get_file_argument() is responsible to extract the relative path
of the file to be served by a specific Moodle component
like a theme or a module.
Some modules like scorm and imscp require slasharguments support
and they force it when creating the URLs to serve their files.
It should honor the slasharguments setting but this could break
those instances where existing hard-coded links still make usage of
the "old" format, the one when slasharguments is set to No i.e. '?file='.
Its logic has been improved by looking at when the URL is related to
serving a plug-in file in a "forced" slasharguments way of serving it
i.e. using '/pluginfile.php/' and not '/pluginfile.php?'.
It was discovered by unit tests that the return value is not a real
boolean as was intuitively expected and documented. To avoid potential
issues with the truthyness in the future, we explicitly cast the return
value to boolean now.
The s() function includes a comment saying that parameter options
should be modified to improve performance once PHP 5.4 is required.
Since Moodle has required PHP 5.4 for some time, we should probably
make the change and remove the comment.
According to my benchmarking, these changes make s() about 7% faster
and will save a staggering 2ms from a typical course view that calls
it 8,000 times.
In MDL-45772 a hack was introduced to some forms to stop browsers from
putting the user's password into password fields in forms unrelated to
logging in.
Chrome now no longer fills the user's password in the first password
field in the page. There now needs to be a plain text input above it
for the username too.
We were previously using an ancient version of html2text from RoundCube
with many customisations.
This patchset moves to the version included in the latest version of
HTML2Text, and wraps the library in a moodle-provided class. This
moves all previous hacks away from that class.
Unfortunately, two hacks still remain - two of the functions in the
RoundCube class are private, and must be modified to protected in order to
use the class effectively.