Code Duplication    Length = 5-6 lines in 3 locations

src/wp-includes/class-wp-xmlrpc-server.php 3 locations

@@ 1454-1459 (lines=6) @@
1451
			unset( $post_data['ping_status'] );
1452
1453
		// Do some timestamp voodoo.
1454
		if ( ! empty( $post_data['post_date_gmt'] ) ) {
1455
			// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
1456
			$dateCreated = rtrim( $post_data['post_date_gmt']->getIso(), 'Z' ) . 'Z';
1457
		} elseif ( ! empty( $post_data['post_date'] ) ) {
1458
			$dateCreated = $post_data['post_date']->getIso();
1459
		}
1460
1461
		// Default to not flagging the post date to be edited unless it's intentional.
1462
		$post_data['edit_date'] = false;
@@ 5139-5143 (lines=5) @@
5136
		}
5137
5138
		// Do some timestamp voodoo
5139
		if ( !empty( $content_struct['date_created_gmt'] ) )
5140
			// We know this is supposed to be GMT, so we're going to slap that Z on there by force
5141
			$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
5142
		elseif ( !empty( $content_struct['dateCreated']) )
5143
			$dateCreated = $content_struct['dateCreated']->getIso();
5144
5145
		if ( !empty( $dateCreated ) ) {
5146
			$post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
@@ 5497-5501 (lines=5) @@
5494
		}
5495
5496
		// Do some timestamp voodoo.
5497
		if ( !empty( $content_struct['date_created_gmt'] ) )
5498
			// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
5499
			$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
5500
		elseif ( !empty( $content_struct['dateCreated']) )
5501
			$dateCreated = $content_struct['dateCreated']->getIso();
5502
5503
		// Default to not flagging the post date to be edited unless it's intentional.
5504
		$edit_date = false;