Code Duplication    Length = 5-7 lines in 2 locations

functions.photon.php 2 locations

@@ 234-238 (lines=5) @@
231
232
	// Keep the crop by using "resize"
233
	if ( ! empty( $wpcom_args['crop'] ) ) {
234
		if ( is_array( $args ) ) {
235
			$args = array_merge( array( 'resize' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
236
		} else {
237
			$args = 'resize=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
238
		}
239
	} else {
240
		if ( is_array( $args ) ) {
241
			$args = array_merge( array( 'fit' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
@@ 239-245 (lines=7) @@
236
		} else {
237
			$args = 'resize=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
238
		}
239
	} else {
240
		if ( is_array( $args ) ) {
241
			$args = array_merge( array( 'fit' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
242
		} else {
243
			$args = 'fit=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
244
		}
245
	}
246
247
	return $args;
248
}