Skip to content

Commit 23d5774

Browse files
committed
consistently use str_replace to unify directory separators
1 parent a935cc6 commit 23d5774

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Iterator/ExcludeDirectoryFilterIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(\Iterator $iterator, array $directories)
4444
public function accept()
4545
{
4646
$path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath();
47-
$path = strtr($path, '\\', '/');
47+
$path = str_replace('\\', '/', $path);
4848
foreach ($this->patterns as $pattern) {
4949
if (preg_match($pattern, $path)) {
5050
return false;

Iterator/PathFilterIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function accept()
2929
$filename = $this->current()->getRelativePathname();
3030

3131
if ('\\' === DIRECTORY_SEPARATOR) {
32-
$filename = strtr($filename, '\\', '/');
32+
$filename = str_replace('\\', '/', $filename);
3333
}
3434

3535
// should at least not match one rule to exclude

0 commit comments

Comments
 (0)