Ticket #1073: bug1073_blankslug_post.diff
File bug1073_blankslug_post.diff, 1.3 KB (added by , 19 years ago) |
---|
-
wp-admin/post.php
104 104 $id_result = $wpdb->get_row("SHOW TABLE STATUS LIKE '$wpdb->posts'"); 105 105 $post_ID = $id_result->Auto_increment; 106 106 107 if ( empty($post_name) || 'draft' == $post_status ) { 108 $post_name = sanitize_title($post_title, $post_ID); 107 if ( empty($post_name) ) { 108 if ( 'draft' != $post_status ) 109 $post_name = sanitize_title($post_title, $post_ID); 109 110 } else { 110 111 $post_name = sanitize_title($post_name, $post_ID); 111 112 } … … 290 291 //if (!$_POST['ping_status']) $ping_status = get_settings('default_ping_status'); 291 292 $post_password = $_POST['post_password']; 292 293 $post_name = $_POST['post_name']; 293 if (empty($post_name)) {294 $post_name = $post_title;295 }296 294 297 295 $post_parent = 0; 298 296 if (isset($_POST['parent_id'])) { … … 308 306 if ( 'publish' == $post_status && (!user_can_create_post($user_ID)) && 2 != get_option('new_users_can_blog') ) 309 307 $post_status = 'draft'; 310 308 311 if (empty($post_name) || 'draft' == $post_status ) { 312 $post_name = sanitize_title($post_title, $post_ID); 309 if ( empty($post_name) ) { 310 if ( 'draft' != $post_status ) 311 $post_name = sanitize_title($post_title, $post_ID); 313 312 } else { 314 313 $post_name = sanitize_title($post_name, $post_ID); 315 314 }