mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
Merge branch 'MDL-62907' of https://github.com/stronk7/moodle
This commit is contained in:
commit
6289f6afe3
@ -73,7 +73,7 @@ trait reader {
|
||||
* @param string $other Other value
|
||||
* @return mixed Decoded value
|
||||
*/
|
||||
public static function decode_other(string $other) {
|
||||
public static function decode_other(?string $other) {
|
||||
if ($other === 'N;' || preg_match('~^.:~', $other)) {
|
||||
return unserialize($other);
|
||||
} else {
|
||||
|
@ -374,6 +374,10 @@ class logstore_standard_store_testcase extends advanced_testcase {
|
||||
$this->assertEquals($value, \logstore_standard\log\store::decode_other(json_encode($value)));
|
||||
}
|
||||
|
||||
public function test_decode_other_with_wrongly_encoded_contents() {
|
||||
$this->assertSame(null, \logstore_standard\log\store::decode_other(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* List of possible values for 'other' field.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user