Code Duplication    Length = 4-4 lines in 2 locations

json-endpoints/class.wpcom-json-api-post-endpoint.php 1 location

@@ 128-131 (lines=4) @@
125
			}
126
		}
127
128
		if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'wp-windows8' ) ) {
129
			remove_shortcode( 'gallery', 'gallery_shortcode' );
130
			add_shortcode( 'gallery', array( &$this, 'win8_gallery_shortcode' ) );
131
		}
132
133
		switch ( $field ) {
134
		case 'name' :

json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php 1 location

@@ 97-100 (lines=4) @@
94
		}
95
96
		// WTF is this?? Why is this responsibility here? Hacks!
97
		if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'wp-windows8' ) ) {
98
			remove_shortcode( 'gallery', 'gallery_shortcode' );
99
			add_shortcode( 'gallery', array( &$this, 'win8_gallery_shortcode' ) );
100
		}
101
102
		// fetch SAL site and post
103
		$post = $this->get_sal_post_by( $field, $field_value, $context );