Ticket #5754 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

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 Assigned to: anonymous
Priority: lowest Milestone: 2.5
Component: General Version: 2.5
Severity: trivial Keywords: has-patch
Cc:

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.

Attachments

5754.diff (393 bytes) - added by lloydbudd on 02/02/08 17:08:26.

Change History

02/02/08 17:08:26 changed by lloydbudd

  • attachment 5754.diff added.

02/02/08 17:10:57 changed by lloydbudd

  • keywords set to has-patch.
  • version set to 2.5.
  • milestone changed from 2.6 to 2.5.

02/06/08 21:40:52 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6741]) Redirect if post not specified. Props lloydbudd. fixes #5754