Code Duplication    Length = 19-19 lines in 2 locations

includes/wpinv-general-functions.php 2 locations

@@ 71-89 (lines=19) @@
68
    return apply_filters( 'wpinv_is_subscriptions_history_page', $ret );
69
}
70
71
function wpinv_send_to_success_page( $args = null ) {
72
	$redirect = wpinv_get_success_page_uri();
73
    
74
    if ( !empty( $args ) ) {
75
        // Check for backward compatibility
76
        if ( is_string( $args ) )
77
            $args = str_replace( '?', '', $args );
78
79
        $args = wp_parse_args( $args );
80
81
        $redirect = add_query_arg( $args, $redirect );
82
    }
83
84
    $gateway = isset( $_REQUEST['wpi-gateway'] ) ? $_REQUEST['wpi-gateway'] : '';
85
    
86
    $redirect = apply_filters( 'wpinv_success_page_redirect', $redirect, $gateway, $args );
87
    wp_redirect( $redirect );
88
    exit;
89
}
90
91
function wpinv_send_to_failed_page( $args = null ) {
92
	$redirect = wpinv_get_failed_transaction_uri();
@@ 91-109 (lines=19) @@
88
    exit;
89
}
90
91
function wpinv_send_to_failed_page( $args = null ) {
92
	$redirect = wpinv_get_failed_transaction_uri();
93
    
94
    if ( !empty( $args ) ) {
95
        // Check for backward compatibility
96
        if ( is_string( $args ) )
97
            $args = str_replace( '?', '', $args );
98
99
        $args = wp_parse_args( $args );
100
101
        $redirect = add_query_arg( $args, $redirect );
102
    }
103
104
    $gateway = isset( $_REQUEST['wpi-gateway'] ) ? $_REQUEST['wpi-gateway'] : '';
105
    
106
    $redirect = apply_filters( 'wpinv_failed_page_redirect', $redirect, $gateway, $args );
107
    wp_redirect( $redirect );
108
    exit;
109
}
110
111
function wpinv_get_checkout_uri( $args = array() ) {
112
	$uri = wpinv_get_option( 'checkout_page', false );