Opened 20 years ago
Closed 20 years ago
#1220 closed defect (bug) (fixed)
Preview results in SQL errors
Reported by: | ryan | Owned by: | ryan |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | major | Version: | 1.5 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
?preview=1 is bad mojo.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Does preview actually do anything useful? The block of code has been sitting in the get_posts() function as long as I can remember, I've always just assumed it was a hangover from the b2 days. This is the code which deals with preview:
if ($qpreview?) {
}
Now, the SQL errors comes because SELECT 1-1 doesn't return any posts, and so nothing is passed to update_post_caches() (and numerous other functions that are expecting it). But the rest of the code makes even less sense: the variable $preview_content isn't mentioned anywhere else in all of WordPress, nore $IEWin_bookmarklet_fix. In other words, this block of code simply changes $request meaning that no posts are matched (resulting in the plethora of SQL errors reported here), then operates a preg_replace on a variable that hasn't been set and is never elsewhere looked at.
Isn't it time we cut the preview code out of WordPress?
edited on: 04-09-05 12:40