Code Duplication    Length = 5-7 lines in 2 locations

functions.photon.php 2 locations

@@ 213-217 (lines=5) @@
210
211
	// Keep the crop by using "resize"
212
	if ( ! empty( $wpcom_args['crop'] ) ) {
213
		if ( is_array( $args ) ) {
214
			$args = array_merge( array( 'resize' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
215
		} else {
216
			$args = 'resize=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
217
		}
218
	} else {
219
		if ( is_array( $args ) ) {
220
			$args = array_merge( array( 'fit' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
@@ 218-224 (lines=7) @@
215
		} else {
216
			$args = 'resize=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
217
		}
218
	} else {
219
		if ( is_array( $args ) ) {
220
			$args = array_merge( array( 'fit' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
221
		} else {
222
			$args = 'fit=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
223
		}
224
	}
225
226
	return $args;
227
}