MDL-55083 admin: provide friendly error in case phpxml is missing
authortunele <antonello.moro1@gmail.com>
Fri, 1 Jul 2016 10:43:20 +0000 (12:43 +0200)
committertunele <antonello.moro1@gmail.com>
Tue, 12 Jul 2016 21:35:15 +0000 (23:35 +0200)
admin/index.php

index 382c252..2cf9d1a 100644 (file)
@@ -52,6 +52,12 @@ if (!function_exists('json_encode') || !function_exists('json_decode')) {
     die();
 }
 
     die();
 }
 
+// Make sure xml extension is available.
+if (!extension_loaded('xml')) {
+    echo 'Moodle requires the xml PHP extension. Please install or enable the xml extension.';
+    die();
+}
+
 define('NO_OUTPUT_BUFFERING', true);
 
 if (isset($_POST['upgradekey'])) {
 define('NO_OUTPUT_BUFFERING', true);
 
 if (isset($_POST['upgradekey'])) {