diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 712eec18..68ed4124 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -21,10 +21,10 @@ class ConnectionHelper { $creds = urlencode($_name) . ':'. urlencode($_pass); - if (strpos($url, 'http://') == 0) { + if (strpos($url, 'http://') === 0) { $new_url = 'http://'. $creds . '@'. substr($url, 7); } - elseif (strpos($url, 'https://') == 0) { + elseif (strpos($url, 'https://') === 0) { $new_url = 'https://'. $creds . '@'. substr($url, 8); } else { diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index f286806c..b3628e24 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -66,8 +66,8 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post } function fedora_available() { - $response = drupal_http_request(variable_get('fedora_base_url', 'http://localhost:8080/fedora').'/describe'); - return ($response->code == 200); + $response = do_curl(variable_get('fedora_base_url', 'http://localhost:8080/fedora').'/describe'); + return strstr($response, 'Repository Information HTML Presentation') !== FALSE; } /**