MDL-78647 files: safer unserializing of file reference data.

This commit is contained in:
Paul Holden 2023-07-05 00:00:59 +01:00 committed by Jenkins
parent cfe33b82e3
commit a11938293e

View File

@ -1957,7 +1957,7 @@ class file_storage {
if ($decoded === false) {
throw new file_reference_exception(null, $str, null, null, 'Invalid base64 format');
}
$params = @unserialize($decoded); // hide E_NOTICE
$params = unserialize_array($decoded);
if ($params === false) {
throw new file_reference_exception(null, $decoded, null, null, 'Not an unserializeable value');
}