Code Duplication    Length = 7-9 lines in 2 locations

modules/widgets/facebook-likebox.php 1 location

@@ 307-315 (lines=9) @@
304
		return (int) $value;
305
	}
306
307
	function normalize_text_value( $value, $default = '', $allowed = array() ) {
308
		$allowed = (array) $allowed;
309
310
		if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) {
311
			$value = $default;
312
		}
313
314
		return $value;
315
	}
316
317
	/**
318
	 * @deprecated

modules/widgets/eu-cookie-law.php 1 location

@@ 296-302 (lines=7) @@
293
		 *
294
		 * @return string $value if pass the check or first value from allowed values.
295
		 */
296
		function filter_value( $value, $allowed = array() ) {
297
			$allowed = (array) $allowed;
298
			if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) {
299
				$value = $allowed[0];
300
			}
301
			return $value;
302
		}
303
	}
304
305
	// Register Jetpack_EU_Cookie_Law_Widget widget.