Opened 9 years ago
Closed 9 years ago
#35246 closed defect (bug) (fixed)
post_exists creates SQL-error
Reported by: | yetAnotherDaniel | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Posts, Post Types | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Function post_exists is missing a space:
<?php 'AND post_content = %s' // wrong ' AND post_content = %s' // correct
Therefore, it produces an SQL error under the following circumstances:
Create a post with empty title and content '123'.
Run at admin:
<?php add_action( 'admin_init', function() { echo post_exists( '', '123' ); exit; });
Produces:
'...You have an error in your SQL syntax...'
I attached a proposal.
Attachments (2)
Change History (5)
#1
@
9 years ago
- Component changed from Administration to Posts, Post Types
- Keywords has-patch has-unit-tests added
- Milestone changed from Awaiting Review to 4.5
- Version changed from 4.4 to 2.8
Introduced in [10722].
Note: See
TracTickets for help on using
tickets.
new post_exists function