Ticket #11390: press-this-fix-entities.patch
File press-this-fix-entities.patch, 1.6 KB (added by , 15 years ago) |
---|
-
wp-admin/press-this.php
43 43 // define some basic variables 44 44 $quick['post_status'] = 'draft'; // set as draft first 45 45 $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null; 46 $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : '';47 $quick['post_title'] = isset($_POST['title']) ? $_POST['title'] : '';48 $quick['post_content'] = '';46 $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null; 47 $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : ' '; 48 $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : ''; 49 49 50 50 // insert the post with nothing in it, to get an ID 51 51 $post_ID = wp_insert_post($quick, true); … … 68 68 $quick['post_content'] = $content; 69 69 // error handling for $post 70 70 if ( is_wp_error($post_ID)) { 71 wp_delete_post($post_ID); 71 72 wp_die($id); 72 wp_delete_post($post_ID);73 73 // error handling for media_sideload 74 74 } elseif ( is_wp_error($upload)) { 75 wp_delete_post($post_ID); 75 76 wp_die($upload); 76 wp_delete_post($post_ID);77 77 } else { 78 78 $quick['ID'] = $post_ID; 79 79 wp_update_post($quick); … … 97 97 $selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection); 98 98 $selection = '<p>'.str_replace('<p></p>', '', $selection).'</p>'; 99 99 } 100 $selection = html_entity_decode($selection); 100 101 101 102 $url = isset($_GET['u']) ? esc_url($_GET['u']) : ''; 102 103 $image = isset($_GET['i']) ? $_GET['i'] : '';