X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/cc7b1505cd9fafd87c3672f669e13e98b0c544f7..022dfbbbe3215917d84708eb09acca93b21ae9e0:/wp-admin/post.php diff --git a/wp-admin/post.php b/wp-admin/post.php index a427d321..44a3ea2d 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -48,11 +48,11 @@ case 'post': break; } } else { - $location = 'post.php?posted=true'; + $location = "post.php?posted=$post_ID"; } if ( 'static' == $_POST['post_status'] ) - $location = "page-new.php?saved=true"; + $location = "page-new.php?saved=$post_ID"; if ( isset($_POST['save']) ) $location = "post.php?action=edit&post=$post_ID"; @@ -81,7 +81,7 @@ case 'edit': ?>

- +
post_status ) + check_admin_referer('delete-page_' . $post_id); + else + check_admin_referer('delete-post_' . $post_id); + if ( !current_user_can('edit_post', $post_id) ) die( __('You are not allowed to delete this post.') ); @@ -154,9 +157,12 @@ case 'delete': } $sendback = wp_get_referer(); - if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php'; - elseif (strstr($sendback, 'attachments.php')) $sendback = get_settings('siteurl') .'/wp-admin/attachments.php'; - $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); + if ( 'static' == $post->post_status ) + $sendback = get_option('siteurl') . '/wp-admin/edit-pages.php'; + elseif ( strstr($sendback, 'post.php') ) + $sendback = get_option('siteurl') .'/wp-admin/post.php'; + elseif ( strstr($sendback, 'attachments.php') ) + $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; wp_redirect($sendback); break; @@ -188,7 +194,7 @@ case 'confirmdeletecomment': $comment = (int) $_GET['comment']; $p = (int) $_GET['p']; - if ( ! $comment = get_comment($comment) ) + if ( ! $comment = get_comment_to_edit($comment) ) die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) @@ -335,13 +341,10 @@ case 'editedcomment': edit_comment(); - $referredby = $_POST['referredby']; - if (!empty($referredby)) { - wp_redirect($referredby); - } else { - wp_redirect("edit.php?p=$comment_post_ID&c=1#comments"); - } - + $location = ( empty($_POST['referredby']) ? "edit.php?p=$comment_post_ID&c=1" : $_POST['referredby'] ) . '#comment-' . $comment_ID; + $location = apply_filters('comment_edit_redirect', $location, $comment_ID); + wp_redirect($location); + exit(); break; default: @@ -349,7 +352,7 @@ default: require_once ('./admin-header.php'); ?> -

View site »'), get_bloginfo('home') . '/'); ?>

+

»

-
+
'.__('WordPress bookmarklet').'

'.__('Right click on the following link and choose "Add to favorites" to create a posting shortcut.').'

'; ?>