X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/449d082fcc4873c1f7d363a0d9f7409be7f6e77d..9c40b4d36daed9e28e48a5fe9205c32557195a4b:/wp-admin/post.php diff --git a/wp-admin/post.php b/wp-admin/post.php index 5f04fa71..008778fa 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -38,21 +38,14 @@ function redirect_post($post_ID = '') { $location = 'sidebar.php?a=c'; elseif ( isset($_POST['publish']) ) $location = 'sidebar.php?a=b'; - } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) { - if ( isset($_POST['_wp_original_http_referer']) && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false ) - $location = add_query_arg( array( - '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), - 'message' => 1 - ), get_edit_post_link( $post_ID, 'url' ) ); - else { - if ( isset( $_POST['publish'] ) ) { - if ( 'pending' == get_post_status( $post_ID ) ) - $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) ); - else - $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) ); - } else { - $location = add_query_arg( 'message', 7, get_edit_post_link( $post_ID, 'url' ) ); - } + } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) { + if ( isset( $_POST['publish'] ) ) { + if ( 'pending' == get_post_status( $post_ID ) ) + $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) ); + else + $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) ); + } else { + $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) ); } } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) { $location = add_query_arg( 'message', 2, wp_get_referer() ); @@ -62,15 +55,6 @@ function redirect_post($post_ID = '') { $location = add_query_arg( 'message', 3, wp_get_referer() ); $location = explode('#', $location); $location = $location[0] . '#postcustom'; - } elseif (!empty($referredby) && $referredby != $referer) { - $location = $_POST['referredby']; - $location = remove_query_arg('_wp_original_http_referer', $location); - if ( false !== strpos($location, 'edit.php') || false !== strpos($location, 'edit-post-drafts.php') ) - $location = add_query_arg('posted', $post_ID, $location); - elseif ( false !== strpos($location, 'wp-admin') ) - $location = "post-new.php?posted=$post_ID"; - } elseif ( isset($_POST['publish']) ) { - $location = "post-new.php?posted=$post_ID"; } elseif ($action == 'editattachment') { $location = 'attachments.php'; } elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) { @@ -131,7 +115,7 @@ case 'edit': $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?") ); + if ( empty($post->ID) ) wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') ); if ( 'post' != $post->post_type ) { wp_redirect( get_edit_post_link( $post->ID, 'url' ) ); @@ -151,7 +135,7 @@ case 'edit': if ( $last = wp_check_post_lock( $post->ID ) ) { $last_user = get_userdata( $last ); $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); - $message = sprintf( __( 'Warning: %s is currently editing this post' ), wp_specialchars( $last_user_name ) ); + $message = sprintf( __( 'Warning: %s is currently editing this post' ), esc_html( $last_user_name ) ); $message = str_replace( "'", "\'", "

$message

" ); add_action('admin_notices', create_function( '', "echo '$message';" ) ); } else {