Skip to content

Commit

Permalink
MDL-60653 Navigation: Fixed loose string comparison.
Browse files Browse the repository at this point in the history
The previous comparison would sometimes evaluate to true when the
navigation key was not a string.
  • Loading branch information
Tyler Bannister authored and rezaies committed Dec 12, 2017
1 parent cb9d984 commit 1ab9160
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public function find($key, $type) {
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);
Expand Down

0 comments on commit 1ab9160

Please sign in to comment.