Index: janode.module =================================================================== --- janode.module (revision 44) +++ janode.module (working copy) @@ -411,11 +411,29 @@ if (isset($url_parts['query']) && strlen($url_parts['query']) > 0) { $full_url .= "?" . drupal_urlencode($url_parts['query']); } - + // currently only support http if ($url_parts['scheme'] != 'http') { $status = _JANODE_NOT_HTTP; } + //Use curl if available. It seems to be more reliable than fopen + elseif(function_exists('curl_exec')) + { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $full_url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $output = curl_exec($ch); + $response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + + if ($response_code == '404') { + $status = _JANODE_FILE_OPEN_FAILURE; + } + elseif($output) { + $status = 0; //url was found + } + else {$status = _JANODE_FILE_OPEN_FAILURE;} + + } else { if(!function_exists('stream_get_meta_data')) { // needed next $status = _JANODE_NO_MATA_DATA;