Code Duplication    Length = 7-7 lines in 2 locations

modules/shortcodes/youtube.php 1 location

@@ 356-362 (lines=7) @@
353
 *
354
 * @param int get_option('embed_autourls') Option to automatically embed all plain text URLs.
355
 */
356
if ( apply_filters( 'jetpack_comments_allow_oembed', get_option('embed_autourls') ) ) {
357
	// We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway, so the iframe gets filtered out.
358
	if ( ! is_admin() ) {
359
		// Higher priority because we need it before auto-link and autop get to it
360
		add_filter( 'comment_text', 'youtube_link', 1 );
361
	}
362
}
363
364
/**
365
 * Core changes to do_shortcode (https://core.trac.wordpress.org/changeset/34747) broke "improper" shortcodes

modules/shortcodes/vimeo.php 1 location

@@ 266-272 (lines=7) @@
263
}
264
265
/** This filter is documented in modules/shortcodes/youtube.php */
266
if ( apply_filters( 'jetpack_comments_allow_oembed', get_option('embed_autourls') ) ) {
267
	// We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway, so the iframe gets filtered out.
268
	if ( ! is_admin() ) {
269
		// Higher priority because we need it before auto-link and autop get to it
270
		add_filter( 'comment_text', 'vimeo_link', 1 );
271
	}
272
}
273