Make WordPress Core

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.

Attachments (1)

5754.diff​ (393 bytes ) - added by lloydbudd 19 years ago.

Download all attachments as: .zip

Change History (3)

#1 @lloydbudd
19 years ago

  • Keywords has-patch added
  • Milestone 2.6 → 2.5
  • Version → 2.5

#2 @ryan
19 years ago

  • Resolution → fixed
  • Status new → closed

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

Note: See TracTickets for help on using tickets.