Code Duplication    Length = 7-8 lines in 2 locations

wp-includes/link-template.php 2 locations

@@ 488-494 (lines=7) @@
485
	if ( !$month )
486
		$month = gmdate('m', current_time('timestamp'));
487
	$monthlink = $wp_rewrite->get_month_permastruct();
488
	if ( !empty($monthlink) ) {
489
		$monthlink = str_replace('%year%', $year, $monthlink);
490
		$monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
491
		$monthlink = home_url( user_trailingslashit( $monthlink, 'month' ) );
492
	} else {
493
		$monthlink = home_url( '?m=' . $year . zeroise( $month, 2 ) );
494
	}
495
496
	/**
497
	 * Filters the month archive permalink.
@@ 1031-1038 (lines=8) @@
1028
1029
	$permastruct = $wp_rewrite->get_search_permastruct();
1030
1031
	if ( empty( $permastruct ) ) {
1032
		$link = home_url('?s=' . urlencode($search) );
1033
	} else {
1034
		$search = urlencode($search);
1035
		$search = str_replace('%2F', '/', $search); // %2F(/) is not valid within a URL, send it un-encoded.
1036
		$link = str_replace( '%search%', $search, $permastruct );
1037
		$link = home_url( user_trailingslashit( $link, 'search' ) );
1038
	}
1039
1040
	/**
1041
	 * Filters the search permalink.