X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/48ab98cb1779cf2088c1351ac3dd3d0da6fb31d3..58b0523c599c731e868bd4bc05b0d686a98d254f:/wp-admin/post.php diff --git a/wp-admin/post.php b/wp-admin/post.php index 805c46e6..9b9b20f8 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -23,7 +23,7 @@ elseif ( isset( $_POST['post_ID'] ) ) else $post_id = $post_ID = 0; -$post = $post_type = $post_type_object = null; +global $post_type, $post_type_object, $post; if ( $post_id ) $post = get_post( $post_id ); @@ -95,7 +95,9 @@ if ( ! $sendback || $sendback = admin_url( 'upload.php' ); } else { $sendback = admin_url( 'edit.php' ); - $sendback .= ( ! empty( $post_type ) ) ? '?post_type=' . $post_type : ''; + if ( ! empty( $post_type ) ) { + $sendback = add_query_arg( 'post_type', $post_type, $sendback ); + } } } else { $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), $sendback ); @@ -113,8 +115,9 @@ case 'post-quickdraft-save': if ( ! wp_verify_nonce( $nonce, 'add-post' ) ) $error_msg = __( 'Unable to submit this form, please refresh and try again.' ); - if ( ! current_user_can( 'edit_posts' ) ) - $error_msg = __( 'Oops, you don’t have access to add new drafts.' ); + if ( ! current_user_can( 'edit_posts' ) ) { + exit; + } if ( $error_msg ) return wp_dashboard_quick_press( $error_msg ); @@ -157,6 +160,7 @@ case 'edit': wp_die( __( 'You can’t edit this item because it is in the Trash. Please restore it and try again.' ) ); if ( ! empty( $_GET['get-post-lock'] ) ) { + check_admin_referer( 'lock-post_' . $post_id ); wp_set_post_lock( $post_id ); wp_redirect( get_edit_post_link( $post_id, 'url' ) ); exit();