Skip to content

Commit

Permalink
return active class as valid HTML
Browse files Browse the repository at this point in the history
this ended up appending the active css class directly to the HTML tag (e.g.
<liclass='active'>) therefore rendering it invalid.
  • Loading branch information
mrtazz committed Dec 9, 2015
1 parent 9f6e2ed commit 0d8e20f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion phplib/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getActiveClassIfRequestMatches($requestUri)
{
$ret = "";
if ($this->requestURI === $requestUri) {
$ret = "class='active'";
$ret = " class='active'";
}

return $ret;
Expand Down
2 changes: 1 addition & 1 deletion tests/Page_tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testGetFooter() {
public function testGetActiveClassIfRequestMatches() {
$this->assertEquals("class='active'", $this->page->getActiveClassIfRequestMatches("/foo"));
$this->assertEquals(" class='active'", $this->page->getActiveClassIfRequestMatches("/foo"));
}

public function testGetTimeSelectBox() {
Expand Down

0 comments on commit 0d8e20f

Please sign in to comment.