Skip to content

Commit

Permalink
Comment: $comment->setApproved() now accept string as parameter. "spam"
Browse files Browse the repository at this point in the history
  • Loading branch information
kayue committed Jul 24, 2012
1 parent a690185 commit 6c59c91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Entity/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,11 @@ public function getKarma()
*/
public function setApproved($approved)
{
$this->approved = $approved ? 1 : 0;
if(is_bool($approved)) {
$this->approved = $approved ? 1 : 0;
}

$this->approved = $approved;
}

/**
Expand All @@ -349,7 +353,7 @@ public function setApproved($approved)
*/
public function getApproved()
{
return $this->approved === 1;
return $this->approved;
}

/**
Expand Down

0 comments on commit 6c59c91

Please sign in to comment.