Code Duplication    Length = 8-8 lines in 2 locations

sal/class.json-api-post-base.php 1 location

@@ 469-476 (lines=8) @@
466
		}
467
468
		// TODO factor this out
469
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
470
			$active_blog = get_active_blog_for_user( $user->ID );
471
			$site_id     = $active_blog->get_id();
472
			$profile_URL = "http://en.gravatar.com/{$user->user_login}";
473
		} else {
474
			$profile_URL = 'http://en.gravatar.com/' . md5( strtolower( trim( $user->user_email ) ) );
475
			$site_id     = -1;
476
		}
477
478
		$author = array(
479
			'ID'          => (int) $user->ID,

class.json-api-endpoints.php 1 location

@@ 1117-1124 (lines=8) @@
1114
				$URL        = $user->user_url;
1115
				$nice       = $user->user_nicename;
1116
			}
1117
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM && ! $is_jetpack ) {
1118
				$active_blog = get_active_blog_for_user( $ID );
1119
				$site_id     = $active_blog->blog_id;
1120
				$profile_URL = "https://en.gravatar.com/{$login}";
1121
			} else {
1122
				$profile_URL = 'https://en.gravatar.com/' . md5( strtolower( trim( $email ) ) );
1123
				$site_id     = -1;
1124
			}
1125
1126
			$avatar_URL = get_avatar_url( $email );
1127
		}