- Timestamp:
- Mar 19, 2017 1:36:34 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r590 r591 1412 1412 1413 1413 /* 1414 * Returns true if the given URL resolves to a resource with a HTTP 2 00header response.1414 * Returns true if the given URL resolves to a resource with a HTTP 2xx or 3xx header response. 1415 1415 * 1416 1416 * @access public … … 1424 1424 { 1425 1425 $ch = curl_init($url); 1426 curl_setopt($ch, CURLOPT_TIMEOUT, 2);1426 curl_setopt($ch, CURLOPT_TIMEOUT, 5); 1427 1427 curl_setopt($ch, CURLOPT_NOBODY, true); 1428 1428 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 1429 1429 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 1430 1430 curl_exec($ch); 1431 return '200' == curl_getinfo($ch, CURLINFO_HTTP_CODE); 1432 } 1431 $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); 1432 return preg_match('/^[23]\d\d$/', $http_code); 1433 }
Note: See TracChangeset
for help on using the changeset viewer.