Fix redirect and publish.

git-svn-id: http://svn.automattic.com/wordpress/trunk@4059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-07-28 22:18:41 +00:00
parent 2c4a4ac455
commit 33a88217f0
1 changed files with 6 additions and 1 deletions

View File

@ -89,13 +89,18 @@ case 'editpost':
$post_ID = edit_post();
$referredby = '';
if ( !empty($_POST['referredby']) )
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
if ($_POST['save']) {
$location = wp_get_referer();
} elseif ($_POST['updatemeta']) {
$location = wp_get_referer() . '&message=2#postcustom';
} elseif ($_POST['deletemeta']) {
$location = wp_get_referer() . '&message=3#postcustom';
} elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) {
} elseif (!empty($referredby) && $referredby != $referer) {
$location = $_POST['referredby'];
if ( $_POST['referredby'] == 'redo' )
$location = get_permalink( $post_ID );