From d8cc1761f13770ec3c8b1c8d4cb29989bab42978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Wed, 22 Jan 2020 13:01:24 +0100 Subject: [PATCH] MDL-67768 core: Add some common dirs to core_component::$ignoreddirs The core_component::$ignoreddirs lists all directories that are reserved and cannot be used as valid plugin names. This is particularly important for some plugin types such as 'webservice' that share the same root location as the core subsystem of the same name. --- lib/classes/component.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/classes/component.php b/lib/classes/component.php index 22edb6ba780..f898c36f58f 100644 --- a/lib/classes/component.php +++ b/lib/classes/component.php @@ -42,8 +42,21 @@ define('ANY_VERSION', 'any'); * Collection of components related methods. */ class core_component { - /** @var array list of ignored directories - watch out for auth/db exception */ - protected static $ignoreddirs = array('CVS'=>true, '_vti_cnf'=>true, 'simpletest'=>true, 'db'=>true, 'yui'=>true, 'tests'=>true, 'classes'=>true, 'fonts'=>true); + /** @var array list of ignored directories in plugin type roots - watch out for auth/db exception */ + protected static $ignoreddirs = [ + 'CVS' => true, + '_vti_cnf' => true, + 'amd' => true, + 'classes' => true, + 'db' => true, + 'fonts' => true, + 'lang' => true, + 'pix' => true, + 'simpletest' => true, + 'templates' => true, + 'tests' => true, + 'yui' => true, + ]; /** @var array list plugin types that support subplugins, do not add more here unless absolutely necessary */ protected static $supportsubplugins = array('mod', 'editor', 'tool', 'local');