MDL-75946 core_h5p: Fixed deprecated FILTER_SANITIZE_STRING

This commit is contained in:
David Woloszyn 2023-01-18 10:13:53 +11:00
parent 67bbf6c416
commit 226bfb0348
2 changed files with 3 additions and 1 deletions

View File

@ -15,7 +15,7 @@ class H5peditorFile {
* Constructor. Process data for file uploaded through the editor.
*/
function __construct($interface) {
$field = filter_input(INPUT_POST, 'field', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
$field = filter_input(INPUT_POST, 'field', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_FLAG_NO_ENCODE_QUOTES);
// Check for file upload.
if ($field === NULL || empty($_FILES) || !isset($_FILES['file'])) {

View File

@ -31,3 +31,5 @@ Changed:
* Add "use stdClass;" in h5peditor.class.php and h5peditor-file.class.php (check that it's still used before replacing it when
upgrading the library).
* Edit language/en.js and remove the content for 'filters' (it's a JSON with several fields, such as level or language).
* If https://github.com/h5p/h5p-editor-php-library/pull/148 hasn't been merged, a patch needs to be added in
h5p/h5plib/v124/joubel/editor/h5peditor-file.class.php, to replace FILTER_SANITIZE_STRING to FILTER_SANITIZE_FULL_SPECIAL_CHARS.