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

@@ 216-222 (lines=7) @@
213
		 *
214
		 * @return string $value if pass the check or first value from allowed values.
215
		 */
216
		function filter_value( $value, $allowed = array() ) {
217
			$allowed = (array) $allowed;
218
			if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) {
219
				$value = $allowed[0];
220
			}
221
			return $value;
222
		}
223
	}
224
225
	// Register Jetpack_EU_Cookie_Law_Widget widget.