Code Duplication    Length = 6-6 lines in 2 locations

modules/widgets/googleplus-badge.php 1 location

@@ 140-145 (lines=6) @@
137
		// Validate the Google+ URL
138
		$instance['href'] = trim( strip_tags( stripslashes( $new_instance['href'] ) ) );
139
140
		if ( $this->is_valid_googleplus_url( $instance['href'] ) ) {
141
			$temp = explode( '?', $instance['href'] );
142
			$instance['href'] = str_replace( array( 'http://plus.google.com', 'https://plus.google.com' ), 'https://plus.google.com', $temp[0] );
143
		} else {
144
			$instance['href'] = '';
145
		}
146
147
		$instance['theme']  = $this->filter_text( $new_instance['theme'],  $this->default_theme,  $this->allowed_themes );
148
		$instance['layout'] = $this->filter_text( $new_instance['layout'], $this->default_layout, $this->allowed_layouts );

modules/widgets/facebook-likebox.php 1 location

@@ 236-241 (lines=6) @@
233
		$args = wp_parse_args( (array) $args, $this->get_default_args() );
234
235
		// Validate the Facebook Page URL
236
		if ( $this->is_valid_facebook_url( $args['href'] ) ) {
237
			$temp = explode( '?', $args['href'] );
238
			$args['href'] = str_replace( array( 'http://facebook.com', 'https://facebook.com' ), array( 'http://www.facebook.com', 'https://www.facebook.com' ), $temp[0] );
239
		} else {
240
			$args['href'] = '';
241
		}
242
243
		$args['width']      = $this->normalize_int_value(  (int) $args['width'], $this->default_width,   $this->max_width,  $this->min_width );
244
		$args['height']     = $this->normalize_int_value(  (int) $args['height'], $this->default_height, $this->max_height, $this->min_height );