Opened 19 years ago
Closed 19 years ago
#5754 closed defect (bug) (fixed)
post.php?action=edit with no &post shouldn't result in "You attempted to edit a post that doesn't exist. Perhaps it was deleted?"
| Reported by: | lloydbudd | Owned by: | |
|---|---|---|---|
| Priority: | lowest | Milestone: | 2.5 |
| Component: | General | Version: | 2.5 |
| Severity: | trivial | Keywords: | has-patch |
| Cc: | Focuses: |
Description
post.php?action=edit with no &post shouldn't result in "You attempted to edit a post that doesn't exist. Perhaps it was deleted?"
ENV: WP trunk r6705 (2.4-bleeding)
When reporting #5753, I noticed that
http://localhost/wp/trunk/wp-admin/post.php?action=edit
results in
You attempted to edit a post that doesn't exist. Perhaps it was deleted?
EXPECTED RESULT
Redirected to http://localhost/wp/trunk/wp-admin/edit.php
just like what happens with you visit http://localhost/wp/trunk/wp-admin/post.php
ADDITIONAL DETAILS
This bug suggests soft logic is used in post.php :
case 'edit':
$title = __('Edit');
$editing = true;
$post_ID = $p = (int) $_GET['post'];
$post = get_post($post_ID);
if ( empty($post->ID) ) wp_die( __("You attempted to edit a post that doesn't exist. Perhaps it was deleted?") );
Severity set to trivial because I know of no real symptom other than the one exposed by #5753.
(In [6741]) Redirect if post not specified. Props lloydbudd. fixes #5754