From f21e00b3c59d25a50c412208b647780d3e3f7ccf Mon Sep 17 00:00:00 2001 From: Lai Wei Date: Wed, 4 Oct 2023 09:54:22 +0100 Subject: [PATCH] Fix an issue in upgrade script in processing system API user token --- local/o365/db/upgrade.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/local/o365/db/upgrade.php b/local/o365/db/upgrade.php index 443658065..b7dc4c71a 100644 --- a/local/o365/db/upgrade.php +++ b/local/o365/db/upgrade.php @@ -723,6 +723,10 @@ function xmldb_local_o365_upgrade($oldversion) { if ($systemtokensconfig !== false) { $systemtokensconfig = unserialize($systemtokensconfig); foreach ($systemtokensconfig as $resource => $tokenconfig) { + // Make sure this is an array. + if (!is_array($tokenconfig)) { + continue; + } if (array_key_exists('resource', $tokenconfig)) { $systemtokensconfig[$resource]['tokenresource'] = $tokenconfig['resource']; unset($systemtokensconfig[$resource]['resource']);