From 79e32f0a7f1da3b7f94e9a414f9bdb0384d1c519 Mon Sep 17 00:00:00 2001 From: thomasmars Date: Thu, 2 Mar 2017 14:21:11 +0100 Subject: [PATCH] Added proper protocol for endpoints HFP-794 --- h5p.classes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index c85091f..85f0116 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -2770,8 +2770,6 @@ class H5PCore { * @return bool|object Returns endpoint data if found, otherwise FALSE */ public function updateContentTypeCache($postData = NULL) { - $endpoint = 'http://api.h5p.org/v1/content-types'; - $interface = $this->h5pF; // Set uuid @@ -2783,7 +2781,9 @@ class H5PCore { $postData['current_cache'] = $this->h5pF->getOption('content_type_cache_updated_at', 0); - $data = $interface->fetchExternalData($endpoint, $postData); + $protocol = (extension_loaded('openssl') ? 'https' : 'http'); + $endpoint = H5PCore::$hubEndpoints[H5PCore::CONTENT_TYPES]; + $data = $interface->fetchExternalData($protocol . $endpoint, $postData); // No data received if (!$data) {