Updated isOwnedBy function to check if not false
Previous code:
```return $this->field('id', array('id' => $post, 'user_id' => $user)) === $post;
Does not work because $this->field() returns a string value when successful and otherwise returns false. The $post variable is of type int.
If $this->field() returns anything other than bool(false) it must mean it found the post_id, but imho matching it against the searched parameter would be useless and parsing String > int or int > String is not that awesome..
Changing === to == would cause posts with id 0 to fail (as 0 == false) therefore I propose the this solution.
Loading
Please sign in to comment