From a364c8f80e8b329f1f068a7d4836608b40e563a0 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Sat, 29 Mar 2008 06:47:30 +0000 Subject: [PATCH] Sync page edit and post edit redirect message usage a bit more -- properly exclude the page.php file from the "go back" link for page edits. git-svn-id: http://svn.automattic.com/wordpress/trunk@7564 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/page.php | 4 ++-- wp-admin/post.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/page.php b/wp-admin/page.php index 1113063317..03c1296806 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -17,10 +17,10 @@ function redirect_page($page_ID) { } elseif ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) { $location = 'sidebar.php?a=b'; } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) { - if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false ) + if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page-new.php') === false ) $location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "page.php?action=edit&post=$page_ID&message=1" ); else - $location = "page.php?action=edit&post=$page_ID"; + $location = "page.php?action=edit&post=$page_ID&message=4"; } elseif ($_POST['addmeta']) { $location = add_query_arg( 'message', 2, wp_get_referer() ); $location = explode('#', $location); diff --git a/wp-admin/post.php b/wp-admin/post.php index febc0b662a..66e0ab761d 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -19,7 +19,7 @@ function redirect_post($post_ID = '') { } elseif ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) { $location = 'sidebar.php?a=b'; } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) { - if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false ) + if ( $_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( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "post.php?action=edit&post=$post_ID&message=1" ); else $location = "post.php?action=edit&post=$post_ID&message=4";