Merge branch 'MDL-42511-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Dan Poltawski 2013-10-28 10:43:07 +08:00
commit c713639b65

View File

@ -1291,11 +1291,13 @@ function portfolio_include_callback_file($component, $class = null) {
// Get rid of the first slash (if it exists).
$component = ltrim($component, '/');
// Get a list of valid plugin types.
$plugintypes = get_plugin_types(false);
$plugintypes = core_component::get_plugin_types();
// Assume it is not valid for now.
$isvalid = false;
// Go through the plugin types.
foreach ($plugintypes as $type => $path) {
// Getting the path relative to the dirroot.
$path = preg_replace('|^' . preg_quote($CFG->dirroot, '|') . '/|', '', $path);
if (strrpos($component, $path) === 0) {
// Found the plugin type.
$isvalid = true;