Code Duplication    Length = 8-13 lines in 2 locations

src/wp-includes/media.php 2 locations

@@ 65-72 (lines=8) @@
62
		$max_height = intval(get_option('medium_size_h'));
63
64
	}
65
	elseif ( $size == 'medium_large' ) {
66
		$max_width = intval( get_option( 'medium_large_size_w' ) );
67
		$max_height = intval( get_option( 'medium_large_size_h' ) );
68
69
		if ( intval( $content_width ) > 0 ) {
70
			$max_width = min( intval( $content_width ), $max_width );
71
		}
72
	}
73
	elseif ( $size == 'large' ) {
74
		/*
75
		 * We're inserting a large size image into the editor. If it's a really
@@ 73-85 (lines=13) @@
70
			$max_width = min( intval( $content_width ), $max_width );
71
		}
72
	}
73
	elseif ( $size == 'large' ) {
74
		/*
75
		 * We're inserting a large size image into the editor. If it's a really
76
		 * big image we'll scale it down to fit reasonably within the editor
77
		 * itself, and within the theme's content width if it's known. The user
78
		 * can resize it in the editor if they wish.
79
		 */
80
		$max_width = intval(get_option('large_size_w'));
81
		$max_height = intval(get_option('large_size_h'));
82
		if ( intval($content_width) > 0 ) {
83
			$max_width = min( intval($content_width), $max_width );
84
		}
85
	} elseif ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) {
86
		$max_width = intval( $_wp_additional_image_sizes[$size]['width'] );
87
		$max_height = intval( $_wp_additional_image_sizes[$size]['height'] );
88
		if ( intval($content_width) > 0 && 'edit' == $context ) // Only in admin. Assume that theme authors know what they're doing.