Code Duplication    Length = 27-27 lines in 2 locations

ipn.php 1 location

@@ 28-54 (lines=27) @@
25
require_once __DIR__ . '/paypal_includes/config.inc.php';
26
27
//decide which post method to use
28
switch ($paypal['post_method']) {
29
30
    case 'libCurl': //php compiled with libCurl support
31
32
        $result = libCurlPost($paypal['url'], $_POST);
33
34
        break;
35
36
    case 'curl': //cURL via command line
37
38
        $result = curlPost($paypal['url'], $_POST);
39
        //print_r($result);
40
        break;
41
42
    case 'fso': //php fsockopen();
43
44
        $result = fsockPost($paypal['url'], $_POST);
45
        //print_r($result);
46
        break;
47
48
    default: //use the fsockopen method as default post method
49
50
        $result = fsockPost($paypal['url'], $_POST);
51
        //print_r($result);
52
        break;
53
54
}
55
56
//check the ipn result received back from paypal
57

ipn/ipn.php 1 location

@@ 25-51 (lines=27) @@
22
require_once __DIR__ . '/../paypal_includes/config.inc.php';
23
24
//decide which post method to use
25
switch ($paypal['post_method']) {
26
27
    case 'libCurl': //php compiled with libCurl support
28
29
        $result = libCurlPost($paypal['url'], $_POST);
30
31
        break;
32
33
    case 'curl': //cURL via command line
34
35
        $result = curlPost($paypal['url'], $_POST);
36
        //print_r($result);
37
        break;
38
39
    case 'fso': //php fsockopen();
40
41
        $result = fsockPost($paypal['url'], $_POST);
42
        //print_r($result);
43
        break;
44
45
    default: //use the fsockopen method as default post method
46
47
        $result = fsockPost($paypal['url'], $_POST);
48
        //print_r($result);
49
        break;
50
51
}
52
53
//check the ipn result received back from paypal
54