Skip to content
Commit 7bf92ec7 authored by Peter Klijn's avatar Peter Klijn
Browse files

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.
parent 3e2b9759
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment