Code Duplication    Length = 8-14 lines in 2 locations

wp-admin/includes/schema.php 1 location

@@ 600-607 (lines=8) @@
597
		AND b.option_value < %d";
598
	$wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( '_transient_' ) . '%', $wpdb->esc_like( '_transient_timeout_' ) . '%', $time ) );
599
600
	if ( is_main_site() && is_main_network() ) {
601
		$sql = "DELETE a, b FROM $wpdb->options a, $wpdb->options b
602
			WHERE a.option_name LIKE %s
603
			AND a.option_name NOT LIKE %s
604
			AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )
605
			AND b.option_value < %d";
606
		$wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( '_site_transient_' ) . '%', $wpdb->esc_like( '_site_transient_timeout_' ) . '%', $time ) );
607
	}
608
}
609
610
/**

wp-admin/includes/upgrade.php 1 location

@@ 1741-1754 (lines=14) @@
1738
	global $wp_current_db_version, $wpdb;
1739
1740
	// Always.
1741
	if ( is_main_network() ) {
1742
		/*
1743
		 * Deletes all expired transients. The multi-table delete syntax is used
1744
		 * to delete the transient record from table a, and the corresponding
1745
		 * transient_timeout record from table b.
1746
		 */
1747
		$time = time();
1748
		$sql = "DELETE a, b FROM $wpdb->sitemeta a, $wpdb->sitemeta b
1749
			WHERE a.meta_key LIKE %s
1750
			AND a.meta_key NOT LIKE %s
1751
			AND b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, 17 ) )
1752
			AND b.meta_value < %d";
1753
		$wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( '_site_transient_' ) . '%', $wpdb->esc_like ( '_site_transient_timeout_' ) . '%', $time ) );
1754
	}
1755
1756
	// 2.8.
1757
	if ( $wp_current_db_version < 11549 ) {