Skip to content

Commit

Permalink
Merge branch '48304-27' of git://github.com/samhemelryk/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_27_STABLE
  • Loading branch information
stronk7 committed Nov 24, 2014
2 parents 0db7d1b + 57476f6 commit 806aba0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/tests/weblib_test.php
Expand Up @@ -285,6 +285,16 @@ public function test_compare_url() {
$this->assertTrue($url1->compare($url2, URL_MATCH_BASE));
$this->assertTrue($url1->compare($url2, URL_MATCH_PARAMS));
$this->assertTrue($url1->compare($url2, URL_MATCH_EXACT));

$url1->set_anchor('test');
$this->assertTrue($url1->compare($url2, URL_MATCH_BASE));
$this->assertTrue($url1->compare($url2, URL_MATCH_PARAMS));
$this->assertFalse($url1->compare($url2, URL_MATCH_EXACT));

$url2->set_anchor('test');
$this->assertTrue($url1->compare($url2, URL_MATCH_BASE));
$this->assertTrue($url1->compare($url2, URL_MATCH_PARAMS));
$this->assertTrue($url1->compare($url2, URL_MATCH_EXACT));
}

public function test_out_as_local_url() {
Expand Down
4 changes: 4 additions & 0 deletions lib/weblib.php
Expand Up @@ -632,6 +632,10 @@ public function compare(moodle_url $url, $matchtype = URL_MATCH_EXACT) {
}
}

if ($url->anchor !== $this->anchor) {
return false;
}

return true;
}

Expand Down

0 comments on commit 806aba0

Please sign in to comment.