Code Duplication    Length = 5-5 lines in 3 locations

classes/class-lsx-wetu-importer-accommodation.php 1 location

@@ 269-273 (lines=5) @@
266
		if ( isset( $_POST['action'] ) && 'lsx_tour_importer' === $_POST['action'] && isset( $_POST['type'] ) && 'accommodation' === $_POST['type'] ) {
267
268
			$searched_items = false;
269
			if ( isset( $_POST['keyword'] ) ) {
270
				$keyphrases = array_map( 'sanitize_text_field', wp_unslash( $_POST['keyword'] ) );
271
			} else {
272
				$keyphrases = array( 0 );
273
			}
274
275
			if ( ! is_array( $keyphrases ) ) {
276
				$keyphrases = array( $keyphrases );

classes/class-lsx-wetu-importer-tours.php 1 location

@@ 299-303 (lines=5) @@
296
297
			if ( false !== $tours ) {
298
				$searched_items = false;
299
				if ( isset( $_POST['keyword'] ) ) {
300
					$keyphrases = array_map( 'sanitize_text_field', wp_unslash( $_POST['keyword'] ) );
301
				} else {
302
					$keyphrases = array( 0 );
303
				}
304
305
				if ( ! is_array( $keyphrases ) ) {
306
					$keyphrases = array( $keyphrases );

classes/class-lsx-wetu-importer-destination.php 1 location

@@ 327-331 (lines=5) @@
324
		if ( isset( $_POST['action'] ) && 'lsx_tour_importer' === $_POST['action'] && isset( $_POST['type'] ) && 'destination' === $_POST['type'] ) {
325
326
			$searched_items = false;
327
			if ( isset( $_POST['keyword'] ) ) {
328
				$keyphrases = array_map( 'sanitize_text_field', wp_unslash( $_POST['keyword'] ) );
329
			} else {
330
				$keyphrases = array( 0 );
331
			}
332
333
			if ( ! is_array( $keyphrases ) ) {
334
				$keyphrases = array( $keyphrases );