MDL-50153 core: Use directory_separator when autoloading psr0 classes
This commit is contained in:
@@ -706,12 +706,12 @@ $cache = '.var_export($cache, true).';
|
||||
*/
|
||||
protected static function load_psr_classes($basedir, $subdir = null) {
|
||||
if ($subdir) {
|
||||
$fulldir = implode(DIRECTORY_SEPARATOR, array($basedir, $subdir));
|
||||
$classnameprefix = preg_replace('/\//', '_', $subdir);
|
||||
$fulldir = realpath($basedir . DIRECTORY_SEPARATOR . $subdir);
|
||||
$classnameprefix = preg_replace('#' . preg_quote(DIRECTORY_SEPARATOR) . '#', '_', $subdir);
|
||||
} else {
|
||||
$fulldir = $basedir;
|
||||
}
|
||||
if (!is_dir($fulldir)) {
|
||||
if (!$fulldir || !is_dir($fulldir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user