| Conditions | 4 |
| Paths | 5 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function check($patterns) |
||
| 11 | { |
||
| 12 | $status = false; |
||
| 13 | |||
| 14 | if (!$blocked = config('firewall.middleware.' . $this->middleware . '.blocked')) { |
||
| 15 | return $status; |
||
| 16 | } |
||
| 17 | |||
| 18 | if (in_array((string) $this->request->server('HTTP_REFERER'), (array) $blocked)) { |
||
| 19 | $status = true; |
||
| 20 | } |
||
| 21 | |||
| 22 | if ($status) { |
||
| 23 | $log = $this->log(); |
||
| 24 | |||
| 25 | event(new AttackDetected($log)); |
||
| 26 | } |
||
| 27 | |||
| 28 | return $status; |
||
| 29 | } |
||
| 30 | } |
||
| 31 |