Code Duplication    Length = 16-16 lines in 2 locations

includes/wpinv-gateway-functions.php 1 location

@@ 726-741 (lines=16) @@
723
    $arg_separator = wpinv_get_php_arg_separator_output();
724
725
    // Verify there is a post_data
726
    if ( $post_data || strlen( $post_data ) > 0 ) {
727
        // Append the data
728
        $encoded_data .= $arg_separator . $post_data;
729
    } else {
730
        // Check if POST is empty
731
        if ( empty( $request ) ) {
732
            // Nothing to do
733
            return;
734
        } else {
735
            // Loop through each POST
736
            foreach ( $request as $key => $value ) {
737
                // Encode the value and append the data
738
                $encoded_data .= $arg_separator . "$key=" . urlencode( $value );
739
            }
740
        }
741
    }
742
743
    // Convert collected post data to an array
744
    parse_str( $encoded_data, $data );

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 );