diff --git a/distroquery.php b/distroquery.php index 880c5d0..f0354e8 100644 --- a/distroquery.php +++ b/distroquery.php @@ -42,6 +42,11 @@ $url_prefix = home_url() . "/rpms/"; $package=get_query_var('package'); $arch=get_query_var('arch'); + $get_args = array( + 'timeout' => 15, + 'sslverify' => false + ); + if ($repo == "") { // @@ -50,7 +55,7 @@ $url_prefix = home_url() . "/rpms/"; echo " > " . _r("Repositories"); echo "

" . _r("Available repositories") . ":

"; - $request = wp_remote_get($api_url . "repositories"); + $request = wp_remote_get($api_url . "repositories", $get_args); if (is_wp_error($request)) { echo "

ERROR: " . $request->get_error_message() . "

"; goto finish; @@ -75,7 +80,7 @@ $url_prefix = home_url() . "/rpms/"; if ($q != "") $query_append .= "&q=" . urlencode($q); if (strlen($query_append) > 0 && $query_append[0] == '&') $query_append[0] = "?"; - $request = wp_remote_get($api_url . "repository/" . $repo . $query_append); + $request = wp_remote_get($api_url . "repository/" . $repo . $query_append, $get_args); if (is_wp_error($request)) { echo "

ERROR: " . $request->get_error_message() . "

"; goto finish; @@ -176,7 +181,7 @@ $url_prefix = home_url() . "/rpms/"; // echo " > " . _r("Repositories") . ""; - $request = wp_remote_get($api_url . "package/" . $repo . "/" . $package); + $request = wp_remote_get($api_url . "package/" . $repo . "/" . $package, $get_args); if (is_wp_error($request)) { echo "

ERROR: " . $request->get_error_message() . "

"; goto finish; @@ -278,8 +283,7 @@ $url_prefix = home_url() . "/rpms/"; // echo " > " . _r("Repositories") . ""; - $request = wp_remote_get($api_url . "package/" . $repo . "/" . $package . "/" . $arch, - array('timeout' => 15)); + $request = wp_remote_get($api_url . "package/" . $repo . "/" . $package . "/" . $arch, $get_args); if (is_wp_error($request)) { echo "
ERROR: " . $request->get_error_message() . "
"; goto finish;