From d1dc08db36b2eb8f9f726357fcb678502917c41f Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Mon, 29 Dec 2025 14:44:27 +0000 Subject: [PATCH] MDL-87358 h5plib_v127: add unicode modifier to title matching regex. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/h5p/h5p-php-library/issues/276 Co-authored-by: Фидан Сынбулатов --- public/h5p/h5plib/v127/joubel/core/h5p.classes.php | 2 +- public/h5p/h5plib/v127/joubel/core/readme_moodle.txt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/h5p/h5plib/v127/joubel/core/h5p.classes.php b/public/h5p/h5plib/v127/joubel/core/h5p.classes.php index a21354f71a5..13e9b0947a2 100644 --- a/public/h5p/h5plib/v127/joubel/core/h5p.classes.php +++ b/public/h5p/h5plib/v127/joubel/core/h5p.classes.php @@ -683,7 +683,7 @@ class H5PValidator { // Schemas used to validate the h5p files private $h5pRequired = array( - 'title' => '/^.{1,255}$/', + 'title' => '/^.{1,255}$/u', 'language' => '/^[-a-zA-Z]{1,10}$/', 'preloadedDependencies' => array( 'machineName' => '/^[\w0-9\-\.]{1,255}$/i', diff --git a/public/h5p/h5plib/v127/joubel/core/readme_moodle.txt b/public/h5p/h5plib/v127/joubel/core/readme_moodle.txt index 862029dcc9b..2c5c2f3ad29 100644 --- a/public/h5p/h5plib/v127/joubel/core/readme_moodle.txt +++ b/public/h5p/h5plib/v127/joubel/core/readme_moodle.txt @@ -44,7 +44,10 @@ The library needs to be saved in the database first before creating the files, b 5. Check if new methods have been added to any of the interfaces. If that's the case, implement them in the proper class. For instance, if a new method is added to h5p-file-storage.interface.php, it should be implemented in h5p/classes/file_storage.php. -6. Open js/h5p.js and in function contentUserDataAjax() add the following patch: +6. In the H5PValidator class in core/h5p.classes.php, ensure $h5pRequired['title'] regular expression contains "u" modifier + until https://github.com/h5p/h5p-php-library/issues/276 is resolved and the library is upgraded to a version containing that fix + +7. Open js/h5p.js and in function contentUserDataAjax() add the following patch: function contentUserDataAjax(contentId, dataType, subContentId, done, data, preload, invalidate, async) { if (H5PIntegration.user === undefined) { // Not logged in, no use in saving.