MDL-76362 mustache: Override parent method to avoid PHP notices

Parent method checks baseDir that is null in this case. This shows notices under PHP 8.1
This commit is contained in:
Marina Glancy 2022-11-17 16:00:44 +01:00 committed by Andrew Nicols
parent 8de12b7997
commit d83368a475

View File

@ -53,4 +53,16 @@ class mustache_filesystem_loader extends \Mustache_Loader_FilesystemLoader {
// Call the Moodle template finder.
return mustache_template_finder::get_template_filepath($name);
}
/**
* Only check if baseDir is a directory and requested templates are files if
* baseDir is using the filesystem stream wrapper.
*
* Always check path for mustache_filesystem_loader.
*
* @return bool Whether to check `is_dir` and `file_exists`
*/
protected function shouldCheckPath() {
return true;
}
}