Code Duplication    Length = 16-16 lines in 2 locations

includes/gateways/paypal.php 1 location

@@ 243-258 (lines=16) @@
240
	$arg_separator = wpinv_get_php_arg_separator_output();
241
242
	// Verify there is a post_data
243
	if ( $post_data || strlen( $post_data ) > 0 ) {
244
		// Append the data
245
		$encoded_data .= $arg_separator.$post_data;
246
	} else {
247
		// Check if POST is empty
248
		if ( empty( $_POST ) ) {
249
			// Nothing to do
250
			return;
251
		} else {
252
			// Loop through each POST
253
			foreach ( $_POST as $key => $value ) {
254
				// Encode the value and append the data
255
				$encoded_data .= $arg_separator."$key=" . urlencode( $value );
256
			}
257
		}
258
	}
259
260
	// Convert collected post data to an array
261
	parse_str( $encoded_data, $encoded_data_array );

includes/wpinv-gateway-functions.php 1 location

@@ 703-718 (lines=16) @@
700
    $arg_separator = wpinv_get_php_arg_separator_output();
701
702
    // Verify there is a post_data
703
    if ( $post_data || strlen( $post_data ) > 0 ) {
704
        // Append the data
705
        $encoded_data .= $arg_separator . $post_data;
706
    } else {
707
        // Check if POST is empty
708
        if ( empty( $request ) ) {
709
            // Nothing to do
710
            return;
711
        } else {
712
            // Loop through each POST
713
            foreach ( $request as $key => $value ) {
714
                // Encode the value and append the data
715
                $encoded_data .= $arg_separator . "$key=" . urlencode( $value );
716
            }
717
        }
718
    }
719
720
    // Convert collected post data to an array
721
    parse_str( $encoded_data, $data );