MDL-76356 various: avoid implicit conversion to arrays
PHP before version 8.1 automatically converted stdClass or 'false' to arrays if function parameter expects array (for example, "reset"). PHP 8.1 shows notices in these situations
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
cd072308e5
commit
66dcb1683b
@@ -1055,7 +1055,7 @@ class completion_info {
|
||||
if (!isset($this->course->cacherev)) {
|
||||
$this->course = get_course($this->course_id);
|
||||
}
|
||||
if ($cacheddata = $completioncache->get($key)) {
|
||||
if ($cacheddata = ($completioncache->get($key) ?: [])) {
|
||||
if ($cacheddata['cacherev'] != $this->course->cacherev) {
|
||||
// Course structure has been changed since the last caching, forget the cache.
|
||||
$cacheddata = array();
|
||||
|
||||
Reference in New Issue
Block a user