diff --git a/src/FileMatchers/EndsWith.php b/src/FileMatchers/EndsWith.php index c5e4260..22213c5 100644 --- a/src/FileMatchers/EndsWith.php +++ b/src/FileMatchers/EndsWith.php @@ -38,6 +38,9 @@ protected function fileEndsWith($haystack, $needle) return $this->fileEndsWith($needle, $haystack); } + $haystack = str_replace('\\', '/', $haystack); + $needle = str_replace('\\', '/', $needle); + return (substr($haystack, -$length) === $needle); } }