mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
MDL-83746 navigation: check host and path for active flag in custom menu
This commit is contained in:
parent
269a8a8a1b
commit
38c2b2ed20
@ -217,6 +217,12 @@ class primary implements renderable, templatable {
|
||||
|
||||
$pathmatches = false;
|
||||
|
||||
// Check for same host names before comparing the path.
|
||||
$currenthost = array_key_exists('host', $current) ? strtolower($current['host']) : '';
|
||||
$nodehost = array_key_exists('host', $nodeurl) ? strtolower($nodeurl['host']) : '';
|
||||
if ($currenthost !== $nodehost) {
|
||||
return false;
|
||||
}
|
||||
// Exact match of the path of node and current url.
|
||||
$nodepath = $nodeurl['path'] ?? '/';
|
||||
$currentpath = $current['path'] ?? '/';
|
||||
|
Loading…
x
Reference in New Issue
Block a user