Code Duplication    Length = 5-5 lines in 2 locations

json-endpoints/class.wpcom-json-api-update-post-v1-1-endpoint.php 1 location

@@ 368-372 (lines=5) @@
365
		// Convert comma-separated terms to array before attempting to
366
		// merge with hardcoded taxonomies
367
		foreach ( $input['terms'] as $taxonomy => $terms ) {
368
			if ( is_string( $terms ) ) {
369
				$input['terms'][ $taxonomy ] = explode( ',', $terms );
370
			} else if ( ! is_array( $terms ) ) {
371
				$input['terms'][ $taxonomy ] = array();
372
			}
373
		}
374
375
		// For each hard-coded taxonomy, merge into terms object

json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php 1 location

@@ 318-322 (lines=5) @@
315
			// Convert comma-separated terms to array before attempting to
316
			// merge with hardcoded taxonomies
317
			foreach ( $input[ $term_input_key ] as $taxonomy => $terms ) {
318
				if ( is_string( $terms ) ) {
319
					$input[ $term_input_key ][ $taxonomy ] = explode( ',', $terms );
320
				} else if ( ! is_array( $terms ) ) {
321
					$input[ $term_input_key ][ $taxonomy ] = array();
322
				}
323
			}
324
325
			// For each hard-coded taxonomy, merge into terms object