MDL-60653 Navigation: Fixed loose string comparison.

The previous comparison would sometimes evaluate to true when the
navigation key was not a string.
This commit is contained in:
Tyler Bannister 2017-11-01 13:24:06 -04:00 committed by Shamim Rezaie
parent 109aa07648
commit e53a38c666

View File

@ -434,7 +434,7 @@ class navigation_node implements renderable {
public function build_flat_navigation_list(flat_navigation $nodes, $showdivider = false) {
if ($this->showinflatnavigation) {
$indent = 0;
if ($this->type == self::TYPE_COURSE || $this->key == self::COURSE_INDEX_PAGE) {
if ($this->type == self::TYPE_COURSE || $this->key === self::COURSE_INDEX_PAGE) {
$indent = 1;
}
$flat = new flat_navigation_node($this, $indent);