Code Duplication    Length = 11-11 lines in 2 locations

modules/shortcodes/archiveorg-book.php 1 location

@@ 26-36 (lines=11) @@
23
 *
24
 * @return int|string
25
 */
26
function jetpack_shortcode_get_archiveorg_book_id( $atts ) {
27
	if ( isset( $atts[0] ) ) {
28
		$atts[0] = trim( $atts[0] , '=' );
29
		if ( preg_match( '#archive.org/stream/(.+)/?$#i', $atts[0], $match ) ) {
30
			$id = $match[1];
31
		} else {
32
			$id = $atts[0];
33
		}
34
		return $id;
35
	}
36
	return 0;
37
}
38
39
/**

modules/shortcodes/archiveorg.php 1 location

@@ 26-36 (lines=11) @@
23
 *
24
 * @return int|string
25
 */
26
function jetpack_shortcode_get_archiveorg_id( $atts ) {
27
	if ( isset( $atts[0] ) ) {
28
		$atts[0] = trim( $atts[0] , '=' );
29
		if ( preg_match( '#archive.org/(details|embed)/(.+)/?$#i', $atts[0], $match ) ) {
30
			$id = $match[2];
31
		} else {
32
			$id = $atts[0];
33
		}
34
		return $id;
35
	}
36
	return 0;
37
}
38
39
/**