MDL-24627 Unknown components are considered activity modules even if their name conta...
[moodle.git] / lib / moodlelib.php
index 073cf57..96d46df 100644 (file)
@@ -6867,6 +6867,11 @@ function normalize_component($component) {
 
     } else {
         list($type, $plugin) = explode('_', $component, 2);
+        $plugintypes = get_plugin_types(false);
+        if ($type !== 'core' and !array_key_exists($type, $plugintypes)) {
+            $type   = 'mod';
+            $plugin = $component;
+        }
     }
 
     return array($type, $plugin);