MDL-80174 tool_log: ensure "other" data is safely unserialized.

This commit is contained in:
Stevani Andolo
2023-12-04 13:41:58 +07:00
committed by Huong Nguyen
parent fe65dccec9
commit 803e4c5c2e
+1 -1
View File
@@ -75,7 +75,7 @@ trait reader {
*/
public static function decode_other(?string $other) {
if ($other === 'N;' || preg_match('~^.:~', $other)) {
return unserialize($other);
return unserialize($other, ['allowed_classes' => [stdClass::class]]);
} else {
return json_decode($other, true);
}