Issues (1149)

ipn/ipn.php (4 issues)

1
<?php
2
/*
3
 * ipn.php
4
 *
5
 * PHP Toolkit for PayPal v0.51
6
 * http://www.paypal.com/pdn
7
 *
8
 * Copyright (c) 2004 PayPal Inc
9
 *
10
 * Released under Common Public License 1.0
11
 * http://opensource.org/licenses/cpl.php
12
 *
13
 */
14
include __DIR__ . '/../header.php';
15
$myts = MyTextSanitizer::getInstance();// MyTextSanitizer object
0 ignored issues
show
The type MyTextSanitizer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
17
$eh = new ErrorHandler;
0 ignored issues
show
The type ErrorHandler was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
//get global configuration information
19
require_once __DIR__ . '/../paypal_includes/global_config.inc.php';
20
21
//get pay pal configuration file
22
require_once __DIR__ . '/../paypal_includes/config.inc.php';
23
24
//decide which post method to use
25 View Code Duplication
switch ($paypal['post_method']) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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();
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
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
55
if (eregi('VERIFIED', $result)) {
56
    require_once __DIR__ . '/ipn_success.php';
57
} else {
58
    require_once __DIR__ . '/ipn_error.php';
59
}
60