From 4e7c680e454b0acaf5a2a4b77e38188e0f5f8d4f Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 1 Apr 2024 21:53:20 +0800 Subject: [PATCH] Standardise filepath separators to / (Fixes #145) --- moodle/Util/Docblocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moodle/Util/Docblocks.php b/moodle/Util/Docblocks.php index bd4fe0b..4c87eff 100644 --- a/moodle/Util/Docblocks.php +++ b/moodle/Util/Docblocks.php @@ -324,7 +324,7 @@ public static function isValidTag( $tag = ltrim($tokens[$tagPtr]['content'], '@'); if (array_key_exists($tag, self::$validTags)) { if (array_key_exists($tag, self::$pathRestrictedTags)) { - $file = $phpcsFile->getFilename(); + $file = str_replace(DIRECTORY_SEPARATOR, "/", $phpcsFile->getFilename()); foreach (self::$pathRestrictedTags[$tag] as $path) { if (preg_match($path, $file)) { return true;