Code Duplication    Length = 12-12 lines in 2 locations

src/wp-includes/bookmark.php 2 locations

@@ 180-191 (lines=12) @@
177
	}
178
179
	$exclusions = '';
180
	if ( ! empty( $r['exclude'] ) ) {
181
		$exlinks = preg_split( '/[\s,]+/', $r['exclude'] );
182
		if ( count( $exlinks ) ) {
183
			foreach ( $exlinks as $exlink ) {
184
				if ( empty( $exclusions ) ) {
185
					$exclusions = ' AND ( link_id <> ' . intval( $exlink ) . ' ';
186
				} else {
187
					$exclusions .= ' AND link_id <> ' . intval( $exlink ) . ' ';
188
				}
189
			}
190
		}
191
	}
192
	if ( ! empty( $exclusions ) ) {
193
		$exclusions .= ')';
194
	}
@@ 215-226 (lines=12) @@
212
213
	$category_query = '';
214
	$join = '';
215
	if ( ! empty( $r['category'] ) ) {
216
		$incategories = preg_split( '/[\s,]+/', $r['category'] );
217
		if ( count($incategories) ) {
218
			foreach ( $incategories as $incat ) {
219
				if ( empty( $category_query ) ) {
220
					$category_query = ' AND ( tt.term_id = ' . intval( $incat ) . ' ';
221
				} else {
222
					$category_query .= ' OR tt.term_id = ' . intval( $incat ) . ' ';
223
				}
224
			}
225
		}
226
	}
227
	if ( ! empty( $category_query ) ) {
228
		$category_query .= ") AND taxonomy = 'link_category'";
229
		$join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id";