Fix redirect and publish.

git-svn-id: https://develop.svn.wordpress.org/trunk@4059 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-07-28 22:18:41 +00:00
parent 85c2f38d41
commit 86b08a2787

View File

@ -89,13 +89,18 @@ case 'editpost':
$post_ID = edit_post(); $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']) { if ($_POST['save']) {
$location = wp_get_referer(); $location = wp_get_referer();
} elseif ($_POST['updatemeta']) { } elseif ($_POST['updatemeta']) {
$location = wp_get_referer() . '&message=2#postcustom'; $location = wp_get_referer() . '&message=2#postcustom';
} elseif ($_POST['deletemeta']) { } elseif ($_POST['deletemeta']) {
$location = wp_get_referer() . '&message=3#postcustom'; $location = wp_get_referer() . '&message=3#postcustom';
} elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) { } elseif (!empty($referredby) && $referredby != $referer) {
$location = $_POST['referredby']; $location = $_POST['referredby'];
if ( $_POST['referredby'] == 'redo' ) if ( $_POST['referredby'] == 'redo' )
$location = get_permalink( $post_ID ); $location = get_permalink( $post_ID );