Code Duplication    Length = 5-6 lines in 3 locations

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

@@ 1372-1377 (lines=6) @@
1369
			unset( $post_data['ping_status'] );
1370
1371
		// Do some timestamp voodoo.
1372
		if ( ! empty( $post_data['post_date_gmt'] ) ) {
1373
			// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
1374
			$dateCreated = rtrim( $post_data['post_date_gmt']->getIso(), 'Z' ) . 'Z';
1375
		} elseif ( ! empty( $post_data['post_date'] ) ) {
1376
			$dateCreated = $post_data['post_date']->getIso();
1377
		}
1378
1379
		// Default to not flagging the post date to be edited unless it's intentional.
1380
		$post_data['edit_date'] = false;
@@ 5027-5031 (lines=5) @@
5024
		}
5025
5026
		// Do some timestamp voodoo
5027
		if ( !empty( $content_struct['date_created_gmt'] ) )
5028
			// We know this is supposed to be GMT, so we're going to slap that Z on there by force
5029
			$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
5030
		elseif ( !empty( $content_struct['dateCreated']) )
5031
			$dateCreated = $content_struct['dateCreated']->getIso();
5032
5033
		if ( !empty( $dateCreated ) ) {
5034
			$post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
@@ 5382-5386 (lines=5) @@
5379
		}
5380
5381
		// Do some timestamp voodoo.
5382
		if ( !empty( $content_struct['date_created_gmt'] ) )
5383
			// We know this is supposed to be GMT, so we're going to slap that Z on there by force.
5384
			$dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';
5385
		elseif ( !empty( $content_struct['dateCreated']) )
5386
			$dateCreated = $content_struct['dateCreated']->getIso();
5387
5388
		// Default to not flagging the post date to be edited unless it's intentional.
5389
		$edit_date = false;