Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#21607 closed defect (bug) (fixed)

post_exists returns 0 and null

Reported by: barrykooij's profile barrykooij Owned by: barrykooij's profile barrykooij
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.4.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

The function post_exists, located in wp-admin/includes/post.php, returns 0 if the arguments are empty but returns null if the query has no result. Because of this the output of the function can't be strictly checked (===).

Changed the 0 return to null.

Attachments (1)

post.php.patch (677 bytes) - added by barrykooij 12 years ago.
post.php patch

Download all attachments as: .zip

Change History (3)

@barrykooij
12 years ago

post.php patch

#1 @markoheijnen
12 years ago

  • Milestone changed from Awaiting Review to 3.5

See also: #21606

#2 @nacin
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 22410:

Always return an integer from post_exists(). props barrykooij. fixes #21607.

Note: See TracTickets for help on using tickets.