diff --git a/h5p/classes/editor.php b/h5p/classes/editor.php index feb3fe895e7..0dd5f01757a 100644 --- a/h5p/classes/editor.php +++ b/h5p/classes/editor.php @@ -444,6 +444,15 @@ class editor { $langcontent = substr($langcontent, 0, strpos($langcontent, '}', -0) + 1); $langcontent = substr($langcontent, strpos($langcontent, '{')); + // Hack by Joseph Rézeau 14 JANUARY 2024. Until H5P OER hub is made available, temporary hack removes un-used filters strings + // which cause PHP warning. + // Find the position of "filters:" + $position = strpos($langcontent, "filters:"); + // If "filters:" is found, truncate the string just before it + if ($position !== false) { + $langcontent = substr($langcontent, 0, $position - 2); + } + // Parse the JS language content and get a PHP array. $editorstrings = helper::parse_js_array($langcontent); foreach ($editorstrings as $key => $value) {