Code Duplication    Length = 5-5 lines in 2 locations

src/wp-includes/post.php 2 locations

@@ 3100-3104 (lines=5) @@
3097
	 * an empty post name.
3098
	 */
3099
	if ( empty($post_name) ) {
3100
		if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) {
3101
			$post_name = sanitize_title($post_title);
3102
		} else {
3103
			$post_name = '';
3104
		}
3105
	} else {
3106
		// On updates, we need to check to see if it's using the old, fixed sanitization context.
3107
		$check_name = sanitize_title( $post_name, '', 'old-save' );
@@ 3143-3147 (lines=5) @@
3140
	}
3141
3142
	if ( empty( $postarr['post_date_gmt'] ) || '0000-00-00 00:00:00' == $postarr['post_date_gmt'] ) {
3143
		if ( ! in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) {
3144
			$post_date_gmt = get_gmt_from_date( $post_date );
3145
		} else {
3146
			$post_date_gmt = '0000-00-00 00:00:00';
3147
		}
3148
	} else {
3149
		$post_date_gmt = $postarr['post_date_gmt'];
3150
	}