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