Code Duplication    Length = 3-3 lines in 5 locations

wp-includes/query.php 5 locations

@@ 2638-2640 (lines=3) @@
2635
		// The "m" parameter is meant for months but accepts datetimes of varying specificity
2636
		if ( $q['m'] ) {
2637
			$where .= " AND YEAR({$this->db->posts}.post_date)=" . substr($q['m'], 0, 4);
2638
			if ( strlen($q['m']) > 5 ) {
2639
				$where .= " AND MONTH({$this->db->posts}.post_date)=" . substr($q['m'], 4, 2);
2640
			}
2641
			if ( strlen($q['m']) > 7 ) {
2642
				$where .= " AND DAYOFMONTH({$this->db->posts}.post_date)=" . substr($q['m'], 6, 2);
2643
			}
@@ 2641-2643 (lines=3) @@
2638
			if ( strlen($q['m']) > 5 ) {
2639
				$where .= " AND MONTH({$this->db->posts}.post_date)=" . substr($q['m'], 4, 2);
2640
			}
2641
			if ( strlen($q['m']) > 7 ) {
2642
				$where .= " AND DAYOFMONTH({$this->db->posts}.post_date)=" . substr($q['m'], 6, 2);
2643
			}
2644
			if ( strlen($q['m']) > 9 ) {
2645
				$where .= " AND HOUR({$this->db->posts}.post_date)=" . substr($q['m'], 8, 2);
2646
			}
@@ 2644-2646 (lines=3) @@
2641
			if ( strlen($q['m']) > 7 ) {
2642
				$where .= " AND DAYOFMONTH({$this->db->posts}.post_date)=" . substr($q['m'], 6, 2);
2643
			}
2644
			if ( strlen($q['m']) > 9 ) {
2645
				$where .= " AND HOUR({$this->db->posts}.post_date)=" . substr($q['m'], 8, 2);
2646
			}
2647
			if ( strlen($q['m']) > 11 ) {
2648
				$where .= " AND MINUTE({$this->db->posts}.post_date)=" . substr($q['m'], 10, 2);
2649
			}
@@ 2647-2649 (lines=3) @@
2644
			if ( strlen($q['m']) > 9 ) {
2645
				$where .= " AND HOUR({$this->db->posts}.post_date)=" . substr($q['m'], 8, 2);
2646
			}
2647
			if ( strlen($q['m']) > 11 ) {
2648
				$where .= " AND MINUTE({$this->db->posts}.post_date)=" . substr($q['m'], 10, 2);
2649
			}
2650
			if ( strlen($q['m']) > 13 ) {
2651
				$where .= " AND SECOND({$this->db->posts}.post_date)=" . substr($q['m'], 12, 2);
2652
			}
@@ 2650-2652 (lines=3) @@
2647
			if ( strlen($q['m']) > 11 ) {
2648
				$where .= " AND MINUTE({$this->db->posts}.post_date)=" . substr($q['m'], 10, 2);
2649
			}
2650
			if ( strlen($q['m']) > 13 ) {
2651
				$where .= " AND SECOND({$this->db->posts}.post_date)=" . substr($q['m'], 12, 2);
2652
			}
2653
		}
2654
2655
		// Handle the other individual date parameters