Code Duplication    Length = 5-7 lines in 2 locations

functions.photon.php 2 locations

@@ 225-229 (lines=5) @@
222
223
	// Keep the crop by using "resize"
224
	if ( ! empty( $wpcom_args['crop'] ) ) {
225
		if ( is_array( $args ) ) {
226
			$args = array_merge( array( 'resize' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
227
		} else {
228
			$args = 'resize=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
229
		}
230
	} else {
231
		if ( is_array( $args ) ) {
232
			$args = array_merge( array( 'fit' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
@@ 230-236 (lines=7) @@
227
		} else {
228
			$args = 'resize=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
229
		}
230
	} else {
231
		if ( is_array( $args ) ) {
232
			$args = array_merge( array( 'fit' => array( $wpcom_args['w'], $wpcom_args['h'] ) ), $args );
233
		} else {
234
			$args = 'fit=' . rawurlencode( absint( $wpcom_args['w'] ) . ',' . absint( $wpcom_args['h'] ) ) . '&' . $args;
235
		}
236
	}
237
238
	return $args;
239
}