diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-24 11:45:39 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-24 11:45:39 +0000 |
| commit | cf9f85dc8121a359d550ffa3b735fb48859eee88 (patch) | |
| tree | 9f90be15fc46163f5656f019f2a2866414b7c9f2 /wp-admin/post.php | |
| parent | f10f9f5b05e23ce4c07479b094bd3ff4bbfd86d0 (diff) | |
| download | wordpress-mu-cf9f85dc8121a359d550ffa3b735fb48859eee88.tar.gz wordpress-mu-cf9f85dc8121a359d550ffa3b735fb48859eee88.tar.xz wordpress-mu-cf9f85dc8121a359d550ffa3b735fb48859eee88.zip | |
Merged with WP 2.5, revision 7806
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1260 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/post.php')
| -rw-r--r-- | wp-admin/post.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/wp-admin/post.php b/wp-admin/post.php index 66e0ab7..b9400b7 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -10,8 +10,10 @@ function redirect_post($post_ID = '') { global $action; $referredby = ''; - if ( !empty($_POST['referredby']) ) + if ( !empty($_POST['referredby']) ) { $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']); + $referredby = remove_query_arg('_wp_original_http_referer', $referredby); + } $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer()); if ( !empty($_POST['mode']) && 'bookmarklet' == $_POST['mode'] ) { @@ -33,6 +35,7 @@ function redirect_post($post_ID = '') { $location = $location[0] . '#postcustom'; } elseif (!empty($referredby) && $referredby != $referer) { $location = $_POST['referredby']; + $location = remove_query_arg('_wp_original_http_referer', $location); if ( $_POST['referredby'] == 'redo' ) $location = get_permalink( $post_ID ); elseif ( false !== strpos($location, 'edit.php') ) @@ -87,15 +90,18 @@ case 'edit': wp_enqueue_script('editor'); wp_enqueue_script('thickbox'); wp_enqueue_script('media-upload'); - 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 = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); - add_action('admin_notices', create_function( '', "echo '$message';" ) ); - } else { - wp_set_post_lock( $post->ID ); - wp_enqueue_script('autosave'); + + if ( current_user_can('edit_post', $post_ID) ) { + 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 = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); + add_action('admin_notices', create_function( '', "echo '$message';" ) ); + } else { + wp_set_post_lock( $post->ID ); + wp_enqueue_script('autosave'); + } } require_once('admin-header.php'); |
