This changes a couple of cases, in postgres and oracle where we
were trying to calculate strlen() on null values (that causes a
PHP 8.1 warning).
Also, at the same time, fixing another case in xmldb_field, it
was detected that it had a bug around precision (being set to the
value of type), being used as object property, when it's not, so
it was also fixed by moving the code logic a little bit.
Note that the bug has been there since inception because there
isn't any code in Moodle using that ->precision property. It
was just detected thanks to PHP 8.2, but that's another story. :-)
Verified that with the patch:
- All DBs can be installed (phpunit install)
- Both DDL and DML pass without any ddl/dml warning (in all DBs).
Prior to this change, all the line endings in the imported HTMLPurifier
library were using CRLF (\r\n aka Windows style), but the HTMLPurifier
source and also the downloadable artefacts use LF (\n aka Linux style)
as line endings. This has been the case since
510d190382003985eafd6f4407190d43509016a5 when with the commit
"MDL-38672 import HTML Purifier 4.5.0" all line endings were changed
from LF to CRLF. There was no comment in the commit on why this change
was done.
As the original source uses LF, this commit partly reverts
510d190382003985eafd6f4407190d43509016a5 and goes back to LF as line
endings.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
The method already loaded the validated persistent model data on the
previous line, there's no need to do it again (while also trying to
load unvalidated properties).
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
The autosave is reset on form submission, but if that form submission
happens at the same time as a page reload, the connection and/or server
is slow, then the connection may be aborted before the session is
removed.
This commit changes the autosave reset to use the fetch() API with a
keepalive flag.
Unfortunately we do not have a formal endpoint for this in Moodle JS so
this is a hackier approach than I would like. MDL-76463 has been opened
to investigate this.
This commit also fixes a situation where the autosave content is re-sent
when the user has typed in the editor and their next action is to click
on the submit button. This is now blocked for that editor instance.
Bootstrap core's "reboot" sets a default text-align which is
incompatible with RTL languages.
Arguably this should be set in the Boost theme, but this is a fairly
large change which has potential to break things so I'm making it here
where we experience the issue for now.