This commit is contained in:
Jun Pataleta 2023-03-01 23:59:40 +08:00
commit 675dadaf55
2 changed files with 5 additions and 1 deletions

View File

@ -1651,7 +1651,7 @@ class core_plugin_manager {
}
// To be able to remove the plugin folder, its parent must be writable, too.
if (!is_writable(dirname($pluginfo->rootdir))) {
if (!isset($pluginfo->rootdir) || !is_writable(dirname($pluginfo->rootdir))) {
return false;
}

View File

@ -598,6 +598,10 @@ abstract class base {
public function get_dir() {
global $CFG;
if (!isset($pluginfo->rootdir)) {
return '';
}
return substr($this->rootdir, strlen($CFG->dirroot));
}