diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 59b1c6903f..258a3f78d2 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -13,6 +13,8 @@ */ if ( ! isset( $post_ID ) ) $post_ID = 0; +else + $post_ID = (int) $post_ID; $action = isset($action) ? $action : ''; if ( isset($_GET['message']) ) @@ -36,10 +38,9 @@ if ( 0 == $post_ID ) { $form_extra = ""; $autosave = false; } else { - $post_ID = (int) $post_ID; $form_action = 'editpost'; $form_extra = ""; - $autosave = wp_get_post_autosave( $post_id ); + $autosave = wp_get_post_autosave( $post_ID ); // Detect if there exists an autosave newer than the post and if that autosave is different than the post if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) { diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index a48e575b85..4e83a1a6c6 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -17,7 +17,8 @@ function _wp_translate_postdata( $update = false ) { $_POST['post_content'] = $_POST['content']; $_POST['post_excerpt'] = $_POST['excerpt']; $_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : ''; - $_POST['to_ping'] = $_POST['trackback_url']; + if ( isset($_POST['trackback_url']) ) + $_POST['to_ping'] = $_POST['trackback_url']; if (!empty ( $_POST['post_author_override'] ) ) { $_POST['post_author'] = (int) $_POST['post_author_override']; @@ -29,7 +30,7 @@ function _wp_translate_postdata( $update = false ) { } } - if ( $_POST['post_author'] != $_POST['user_ID'] ) { + if ( isset($_POST['user_ID']) && ($_POST['post_author'] != $_POST['user_ID']) ) { if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can( 'edit_others_pages' ) ) { return new WP_Error( 'edit_others_pages', $update ? @@ -66,7 +67,7 @@ function _wp_translate_postdata( $update = false ) { if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') ) $_POST['post_status'] = 'pending'; } else { - if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) : + if ( isset($_POST['post_status']) && ('publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' )) ) : // Stop attempts to publish new posts, but allow already published posts to be saved if appropriate. if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') ) $_POST['post_status'] = 'pending'; diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 8e19eca536..4e05c746df 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -917,7 +917,7 @@ function user_row( $user_object, $style = '', $role = '' ) { } else { $edit = $user_object->user_login; } - $role_name = $wp_roles->role_names[$role] ? translate_with_context($wp_roles->role_names[$role]) : __('None'); + $role_name = isset($wp_roles->role_names[$role]) ? translate_with_context($wp_roles->role_names[$role]) : __('None'); $r = "