Changeset 6339 for trunk/wp-includes/functions.php
- Timestamp:
- 11/17/2007 11:21:34 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r6250 r6339 1485 1485 } 1486 1486 1487 /** 1488 * Determines if the blog can be accessed over SSL 1489 * @return bool whether of not SSL access is available 1490 */ 1491 function url_is_accessable_via_ssl($url) 1492 { 1493 if (in_array('curl', get_loaded_extensions())) { 1494 $ssl = preg_replace( '/^http:\/\//', 'https://', $url ); 1495 1496 $ch = curl_init(); 1497 curl_setopt($ch, CURLOPT_URL, $ssl); 1498 curl_setopt($ch, CURLOPT_FAILONERROR, true); 1499 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 1500 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 1501 1502 $data = curl_exec ($ch); 1503 1504 $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); 1505 curl_close ($ch); 1506 1507 if ($status == 200 || $status == 401) { 1508 return true; 1509 } 1510 } 1511 return false; 1512 } 1513 1514 function atom_service_url_filter($url) 1515 { 1516 if ( url_is_accessable_via_ssl($url) ) 1517 return preg_replace( '/^http:\/\//', 'https://', $url ); 1518 } 1487 1519 ?>
Note: See TracChangeset
for help on using the changeset viewer.