Protector_precommon_badip_errorlog   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 11 3
1
<?php
2
3
/**
4
 * Class protector_precommon_badip_errorlog
5
 */
6
class Protector_precommon_badip_errorlog extends ProtectorFilterAbstract
7
{
8
    public function execute()
9
    {
10
        echo _MD_PROTECTOR_YOUAREBADIP;
11
        $protector = Protector::getInstance();
12
        if ($protector->ip_matched_info) {
13
            printf(_MD_PROTECTOR_FMT_JAILINFO, date(_MD_PROTECTOR_FMT_JAILTIME, $protector->ip_matched_info));
14
        }
15
        if (isset($_SERVER['REMOTE_ADDR'])) {
16
            error_log('Protector: badip ' . $_SERVER['REMOTE_ADDR'], 0);
17
        }
18
        exit;
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
19
    }
20
}
21