Opened 11 years ago
Closed 11 years ago
#35246 closed defect (bug) (fixed)
post_exists creates SQL-error
| Reported by: | yetAnotherDaniel | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5 |
| Component: | Posts, Post Types | Version: | 2.8 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
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
@
11 years ago
- Component Administration → Posts, Post Types
- Keywords has-patch has-unit-tests added
- Milestone Awaiting Review → 4.5
- Version 4.4 → 2.8
Introduced in [10722].
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
new post_exists function