Code Duplication    Length = 13-17 lines in 2 locations

wp-includes/ms-blogs.php 2 locations

@@ 177-189 (lines=13) @@
174
	$all = $get_all == true ? '' : 'short';
175
	$details = wp_cache_get( $blog_id . $all, 'blog-details' );
176
177
	if ( $details ) {
178
		if ( ! is_object( $details ) ) {
179
			if ( $details == -1 ) {
180
				return false;
181
			} else {
182
				// Clear old pre-serialized objects. Cache clients do better with that.
183
				wp_cache_delete( $blog_id . $all, 'blog-details' );
184
				unset($details);
185
			}
186
		} else {
187
			return $details;
188
		}
189
	}
190
191
	// Try the other cache.
192
	if ( $get_all ) {
@@ 194-210 (lines=17) @@
191
	// Try the other cache.
192
	if ( $get_all ) {
193
		$details = wp_cache_get( $blog_id . 'short', 'blog-details' );
194
	} else {
195
		$details = wp_cache_get( $blog_id, 'blog-details' );
196
		// If short was requested and full cache is set, we can return.
197
		if ( $details ) {
198
			if ( ! is_object( $details ) ) {
199
				if ( $details == -1 ) {
200
					return false;
201
				} else {
202
					// Clear old pre-serialized objects. Cache clients do better with that.
203
					wp_cache_delete( $blog_id, 'blog-details' );
204
					unset($details);
205
				}
206
			} else {
207
				return $details;
208
			}
209
		}
210
	}
211
212
	if ( empty($details) ) {
213
		$details = WP_Site::get_instance( $blog_id );