| Conditions | 5 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function IsOkForsafeBrowsing($url) |
||
| 22 | { |
||
| 23 | $url = 'https://transparencyreport.google.com/transparencyreport/api/v3/safebrowsing/status?site='.$url; |
||
| 24 | $curl = new CurlRequest($url); |
||
| 25 | $curl->setDestkopUserAgent(); |
||
| 26 | $curl->setReturnHeader(); |
||
| 27 | if (isset($this->proxy)) { |
||
| 28 | $curl->setProxy($this->proxy); |
||
| 29 | } |
||
| 30 | $output = $curl->execute(); |
||
| 31 | $headers = $curl->getHeader(); |
||
| 32 | if ($curl->hasError() || false !== strpos($output, '<title>Sorry...</title>')) { |
||
| 33 | return false; |
||
| 34 | } |
||
| 35 | |||
| 36 | //return strpos($output, 'Ce site n\'est actuellement pas') !== false ? true : false; |
||
| 37 | return false !== strpos($headers[0], '200') ? true : false; |
||
| 38 | } |
||
| 40 |