Code Duplication    Length = 5-7 lines in 2 locations

functions.photon.php 2 locations

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