diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index f078dcf4d2..f375368483 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -212,17 +212,37 @@ function get_post_to_edit($id) { // Default post information to use when populating the "Write Post" form. function get_default_post_to_edit() { - global $content, $excerpt, $edited_post_title; + if ( !empty($_REQUEST['post_title']) ) + $post_title = wp_specialchars(stripslashes($_REQUEST['post_title'])); + else if ( !empty($_REQUEST['popuptitle']) ) { + $post_title = wp_specialchars(stripslashes($_REQUEST['popuptitle'])); + $post_title = funky_javascript_fix($post_title); + } else { + $post_title = ''; + } + + if ( !empty($_REQUEST['content']) ) + $post_content = wp_specialchars(stripslashes($_REQUEST['content'])); + else if ( !empty($post_title) ) { + $text = wp_specialchars(stripslashes(urldecode($_REQUEST['text']))); + $text = funky_javascript_fix($text); + $popupurl = wp_specialchars($_REQUEST['popupurl']); + $post_content = ''.$post_title.''."\n$text"; + } + + if ( !empty($_REQUEST['excerpt']) ) + $post_excerpt = wp_specialchars(stripslashes($_REQUEST['excerpt'])); + else + $post_excerpt = ''; $post->post_status = 'draft'; $post->comment_status = get_settings('default_comment_status'); $post->ping_status = get_settings('default_ping_status'); $post->post_pingback = get_settings('default_pingback_flag'); $post->post_category = get_settings('default_category'); - $content = wp_specialchars($content); - $post->post_content = apply_filters('default_content', $content); - $post->post_title = apply_filters('default_title', $edited_post_title); - $post->post_excerpt = apply_filters('default_excerpt', $excerpt); + $post->post_content = apply_filters('default_content', $post_content); + $post->post_title = apply_filters('default_title', $post_title); + $post->post_excerpt = apply_filters('default_excerpt', $post_excerpt); $post->page_template = 'default'; $post->post_parent = 0; $post->menu_order = 0; diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 37198edfa7..fab4f20cd6 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -8,6 +8,10 @@ $messages[3] = __('Custom field deleted.');