MDL-74407 navigation: Perform a strict array_search for node keys

Perform strict array_search due to conflicting results in versions <php8.0
This commit is contained in:
Peter Dias 2022-04-14 12:25:15 +08:00
parent 5423e5f443
commit 40ad488405

View file

@ -417,7 +417,7 @@ class secondary extends view {
if ($courseadminnode) {
foreach ($courseadminnode->children as $other) {
if (array_search($other->key, $expectedcourseadmin) === false) {
if (array_search($other->key, $expectedcourseadmin, true) === false) {
$othernode = $this->get_first_action_for_node($other);
$recursivenode = $othernode && !$rootnode->get($othernode->key) ? $othernode : $other;
// Get the first node and check whether it's been added already.