| Conditions | 5 |
| Paths | 7 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function check($patterns) |
||
| 11 | { |
||
| 12 | $protected = false; |
||
| 13 | |||
| 14 | if (!$inspections = config('firewall.middleware.' . $this->middleware . '.inspections')) { |
||
| 15 | return $protected; |
||
| 16 | } |
||
| 17 | |||
| 18 | foreach ($inspections as $inspection) { |
||
| 19 | if (!$this->request->is($inspection)) { |
||
| 20 | continue; |
||
| 21 | } |
||
| 22 | |||
| 23 | $protected = true; |
||
| 24 | |||
| 25 | break; |
||
| 26 | } |
||
| 27 | |||
| 28 | if ($protected) { |
||
| 29 | $log = $this->log(); |
||
| 30 | |||
| 31 | event(new AttackDetected($log)); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $protected; |
||
| 35 | } |
||
| 36 | } |
||
| 37 |