Code Duplication    Length = 11-13 lines in 2 locations

class.jetpack-post-images.php 2 locations

@@ 129-139 (lines=11) @@
126
				$image_size = isset( $gallery['size'] ) ? $gallery['size'] : 'thumbnail';
127
				foreach ( $image_ids as $image_id ) {
128
					$image = wp_get_attachment_image_src( $image_id, $image_size );
129
					if ( ! empty( $image[0] ) ) {
130
						list( $raw_src ) = explode( '?', $image[0] ); // pull off any Query string (?w=250)
131
						$raw_src = wp_specialchars_decode( $raw_src ); // rawify it
132
						$raw_src = esc_url_raw( $raw_src ); // clean it
133
						$images[] = array(
134
							'type'  => 'image',
135
							'from'  => 'gallery',
136
							'src'   => $raw_src,
137
							'href'  => $permalink,
138
						);
139
					}
140
				}
141
			} elseif ( ! empty( $gallery['src'] ) ) {
142
				foreach ( $gallery['src'] as $src ) {
@@ 141-153 (lines=13) @@
138
						);
139
					}
140
				}
141
			} elseif ( ! empty( $gallery['src'] ) ) {
142
				foreach ( $gallery['src'] as $src ) {
143
					list( $raw_src ) = explode( '?', $src ); // pull off any Query string (?w=250)
144
					$raw_src = wp_specialchars_decode( $raw_src ); // rawify it
145
					$raw_src = esc_url_raw( $raw_src ); // clean it
146
					$images[] = array(
147
						'type'  => 'image',
148
						'from'  => 'gallery',
149
						'src'   => $raw_src,
150
						'href'  => $permalink,
151
					);
152
				}
153
			}
154
		}
155
156
		return $images;