Code Duplication    Length = 7-8 lines in 3 locations

modules/widgets/googleplus-badge.php 1 location

@@ 304-311 (lines=8) @@
301
		return ( FALSE !== strpos( $url, 'plus.google.com' ) ) ? TRUE : FALSE;
302
	}
303
304
	function filter_text( $value, $default = '', $allowed = array() ) {
305
		$allowed = (array) $allowed;
306
307
		if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) )
308
			$value = $default;
309
310
		return $value;
311
	}
312
}
313
314
// END

modules/widgets/facebook-likebox.php 1 location

@@ 282-289 (lines=8) @@
279
		return (int) $value;
280
	}
281
282
	function normalize_text_value( $value, $default = '', $allowed = array() ) {
283
		$allowed = (array) $allowed;
284
285
		if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) )
286
			$value = $default;
287
288
		return $value;
289
	}
290
291
	/**
292
	 * @deprecated

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

@@ 247-253 (lines=7) @@
244
		 *
245
		 * @return string $value if pass the check or first value from allowed values.
246
		 */
247
		function filter_value( $value, $allowed = array() ) {
248
			$allowed = (array) $allowed;
249
			if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) {
250
				$value = $allowed[0];
251
			}
252
			return $value;
253
		}
254
	}
255
256
	// Register Jetpack_EU_Cookie_Law_Widget widget.