Code Duplication    Length = 11-13 lines in 2 locations

class.jetpack-post-images.php 2 locations

@@ 102-112 (lines=11) @@
99
				$image_size = isset( $gallery['size'] ) ? $gallery['size'] : 'thumbnail';
100
				foreach ( $image_ids as $image_id ) {
101
					$image = wp_get_attachment_image_src( $image_id, $image_size );
102
					if ( ! empty( $image[0] ) ) {
103
						list( $raw_src ) = explode( '?', $image[0] ); // pull off any Query string (?w=250)
104
						$raw_src = wp_specialchars_decode( $raw_src ); // rawify it
105
						$raw_src = esc_url_raw( $raw_src ); // clean it
106
						$images[] = array(
107
							'type'  => 'image',
108
							'from'  => 'gallery',
109
							'src'   => $raw_src,
110
							'href'  => $permalink,
111
						);
112
					}
113
				}
114
			} elseif ( ! empty( $gallery['src'] ) ) {
115
				foreach ( $gallery['src'] as $src ) {
@@ 114-126 (lines=13) @@
111
						);
112
					}
113
				}
114
			} elseif ( ! empty( $gallery['src'] ) ) {
115
				foreach ( $gallery['src'] as $src ) {
116
					list( $raw_src ) = explode( '?', $src ); // pull off any Query string (?w=250)
117
					$raw_src = wp_specialchars_decode( $raw_src ); // rawify it
118
					$raw_src = esc_url_raw( $raw_src ); // clean it
119
					$images[] = array(
120
						'type'  => 'image',
121
						'from'  => 'gallery',
122
						'src'   => $raw_src,
123
						'href'  => $permalink,
124
					);
125
				}
126
			}
127
		}
128
129
		return $images;