Conditions | 4 |
Paths | 8 |
Total Lines | 32 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | public function process() |
||
9 | { |
||
10 | $this->initWrapper($this->setLocalName()); |
||
11 | |||
|
|||
12 | |||
13 | list($name, $email) = explode('|', $this->getReference()); |
||
14 | |||
15 | $name = trim($name); |
||
16 | $emailName = ''; |
||
17 | $sanitise = $this->soteria->sanitise(); |
||
18 | $sanitise->disinfect($email, 'email'); |
||
19 | |||
20 | if ($sanitise->result()->isValid()) { |
||
21 | $email = explode("@",$sanitise->result()->getOutput()); |
||
22 | $email_characters = ['.','+','-','_']; |
||
23 | $emailName = str_replace($email_characters,' ',strtolower($email[0])); |
||
24 | } |
||
25 | |||
26 | |||
27 | $sanitise = $this->soteria->sanitise(); |
||
28 | $sanitise->disinfect($name); |
||
29 | |||
30 | if ($sanitise->result()->isValid()) { |
||
31 | $name = strtolower($sanitise->result()->getOutput()); |
||
32 | } |
||
33 | |||
34 | if (strcasecmp($name, $emailName) == 0) { |
||
35 | $this->setScore($this->getRealScore()); |
||
36 | $this->setResult(); |
||
37 | } else { |
||
38 | $this->setScore($this->getFailScore()); |
||
39 | $this->setResult(); |
||
40 | } |
||
49 | } |