Skip to content

Commit

Permalink
Merge branch 'MDL-62907' of https://github.com/stronk7/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllaó committed Apr 17, 2019
2 parents 0423ed4 + 65453b9 commit 6289f6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion admin/tool/log/classes/helper/reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function get_description() {
* @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 {
Expand Down
4 changes: 4 additions & 0 deletions admin/tool/log/store/standard/tests/store_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ public function test_decode_other($value) {
$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.
*
Expand Down

0 comments on commit 6289f6a

Please sign in to comment.