-
Bug
-
Resolution: Fixed
-
Minor
-
3.11
-
MOODLE_311_STABLE
-
MOODLE_310_STABLE, MOODLE_311_STABLE
-
MDL-71637-master -
-
1
-
QA blitz 3
As of PHP 8.0.0, a ValueError is thrown if the value of to_encoding or from_encoding is an invalid encoding. Prior to PHP 8.0.0, a E_WARNING was emitted instead.
https://www.php.net/manual/en/function.mb-convert-encoding.php
code:
$subst = mb_substitute_character();
mb_substitute_character(''); // <=EXCEPTION
$result = mb_convert_encoding($value, 'utf-8', 'utf-8');
mb_substitute_character($subst);
!!! Exception - mb_substitute_character(): Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint !!!
!!
Error code: generalexceptionmessage !!
!! Stack trace: * line 1287 of /lib/moodlelib.php: ValueError thrown
- line 1287 of /lib/moodlelib.php: call to mb_substitute_character()
- line 995 of /lib/moodlelib.php: call to fix_utf8()
- line 1267 of /lib/filestorage/file_storage.php: call to clean_param()
- line 51 of /mod/assign/feedback/editpdf/db/install.php: call to file_storage->create_file_from_pathname()
- line 676 of /lib/upgradelib.php: call to xmldb_assignfeedback_editpdf_install()
- line 1929 of /lib/upgradelib.php: call to upgrade_plugins()
- line 489 of /lib/installlib.php: call to upgrade_noncore()
- line 35 of /local/kos/cli/dev/fresh_install.php: call to install_cli_database()
!!
same for:
{"time":"2021-05-16 00:13:07","type":"exception","message":"mb_substitute_character(): Argument #1 ($substitute_character) must be \"none\", \"long\", \"entity\" or a valid codepoint","file":"\/var\/www\/moodle\/lib\/configonlylib.php","line":107,"trace":"#0 \/var\/www\/moodle\/lib\/configonlylib.php(107): mb_substitute_character()\n#1 \/var\/www\/moodle\/lib\/configonlylib.php(67): min_fix_utf8()\n#2 \/var\/www\/moodle\/theme\/styles.php(49): min_clean_param()\n#3 \{main}
"}
- has a non-specific relationship to
-
MDL-70745 Prepare Moodle for PHP 8.0
-
- Closed
-