Code Duplication    Length = 16-16 lines in 2 locations

includes/gateways/paypal.php 1 location

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

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