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

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