| Conditions | 5 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 2 | private function browserHasWorkingCSPImplementation() |
|
| 34 | { |
||
| 35 | 2 | $agent = strtolower( |
|
| 36 | 2 | $this->owner->getRequest()->getHeader('User-Agent') |
|
| 37 | 2 | ); |
|
| 38 | |||
| 39 | 2 | if (strpos($agent, 'safari') === false) { |
|
| 40 | 1 | return true; |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | $split = explode('version/', $agent); |
|
| 44 | |||
| 45 | 1 | if (!isset($split[1])) { |
|
| 46 | 1 | return true; |
|
| 47 | } |
||
| 48 | |||
| 49 | 1 | $version = trim($split[1]); |
|
| 50 | 1 | $versions = explode('.', $version); |
|
| 51 | |||
| 52 | 1 | if (isset($versions[0]) && $versions[0] <= 5) { |
|
| 53 | 1 | return false; |
|
| 54 | } |
||
| 55 | |||
| 56 | 1 | return true; |
|
| 57 | } |
||
| 58 | |||
| 60 |