diff --git a/admin/environment.xml b/admin/environment.xml
index 5775d1a59a72..8b982f2c1260 100644
--- a/admin/environment.xml
+++ b/admin/environment.xml
@@ -1145,6 +1145,11 @@
+
+
+
+
+
@@ -1418,6 +1423,11 @@
+
+
+
+
+
@@ -1556,6 +1566,11 @@
+
+
+
+
+
@@ -1701,6 +1716,11 @@
+
+
+
+
+
@@ -1851,6 +1871,11 @@
+
+
+
+
+
diff --git a/lang/en/admin.php b/lang/en/admin.php
index d650274d037c..61e86960c434 100644
--- a/lang/en/admin.php
+++ b/lang/en/admin.php
@@ -631,6 +631,7 @@
$string['legacyfilesaddallowed_help'] = 'If a course has legacy course files, allow new files and folders to be added to it.';
$string['legacyfilesinnewcourses'] = 'Legacy course files in new courses';
$string['legacyfilesinnewcourses_help'] = 'By default, legacy course files areas are available in upgraded courses only. Please note that some features such as activity backup and restore are not compatible with this setting.';
+$string['libcurlwarning'] = 'Libcurl with CURLOPT_PROTOCOL support has not been detected. It is recommended to have an up to date libcurl installation for security reasons.';
$string['licensesettings'] = 'Licence settings';
$string['linkadmincategories'] = 'Link admin categories';
$string['linkadmincategories_help'] = 'If enabled admin setting categories will be displayed as links in the navigation and will lead to the admin category pages.';
diff --git a/lib/tests/upgradelib_test.php b/lib/tests/upgradelib_test.php
index eaeb63d0b3e6..2d99c106d83e 100644
--- a/lib/tests/upgradelib_test.php
+++ b/lib/tests/upgradelib_test.php
@@ -866,4 +866,20 @@ private function assign_good_letter_boundary($contextid) {
$DB->insert_record('grade_letters', $record);
}
}
+
+ /**
+ * Test libcurl custom check api.
+ */
+ public function test_check_libcurl_version() {
+ $supportedversion = 0x071304;
+ $curlinfo = curl_version();
+ $currentversion = $curlinfo['version_number'];
+
+ $result = new environment_results("custom_checks");
+ if ($currentversion < $supportedversion) {
+ $this->assertFalse(check_libcurl_version($result)->getStatus());
+ } else {
+ $this->assertNull(check_libcurl_version($result));
+ }
+ }
}
diff --git a/lib/upgradelib.php b/lib/upgradelib.php
index c4da21445bf7..32b4a84e39dc 100644
--- a/lib/upgradelib.php
+++ b/lib/upgradelib.php
@@ -2347,3 +2347,32 @@ function check_tls_libraries(environment_results $result) {
return null;
}
+
+/**
+ * Check if recommended version of libcurl is installed or not.
+ *
+ * @param environment_results $result object to update, if relevant.
+ * @return environment_results|null updated results or null.
+ */
+function check_libcurl_version(environment_results $result) {
+
+ // Supported version and version number.
+ $supportedversion = 0x071304;
+ $supportedversionstring = "7.19.4";
+
+ // Installed version.
+ $curlinfo = curl_version();
+ $currentversion = $curlinfo['version_number'];
+
+ if ($currentversion < $supportedversion) {
+ // Test fail.
+ // Set info, we want to let user know how to resolve the problem.
+ $result->setInfo('Libcurl version check');
+ $result->setNeededVersion($supportedversionstring);
+ $result->setCurrentVersion($curlinfo['version']);
+ $result->setStatus(false);
+ return $result;
+ }
+
+ return null;
+}
diff --git a/version.php b/version.php
index 12b6ffae15b2..c3159d3f4272 100644
--- a/version.php
+++ b/version.php
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2016110800.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2016110800.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.