Skip to content

Commit

Permalink
fixup! Various path normalisations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Apr 1, 2024
1 parent d8ef926 commit 390f272
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moodle/Util/MoodleUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public static function getMoodleRoot(?File $file = null, bool $selfPath = true):
// Still not found, let's look upwards for a main version file and config-dist.php file
// starting from the file path being checked (given it has been passed).
if ($file instanceof File) {
$path = $lastPath = self::getStandardisedFilename($file));
$path = $lastPath = self::getStandardisedFilename($file);
while (($path = pathinfo($path, PATHINFO_DIRNAME)) !== $lastPath) {
// If we find both a version.php and config-dist.php file then we have arrived to moodle root.
if (is_readable($path . '/version.php') && is_readable($path . '/config-dist.php')) {
Expand Down

0 comments on commit 390f272

Please sign in to comment.