Code Duplication    Length = 11-13 lines in 2 locations

class.jetpack-post-images.php 2 locations

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