[Finder] fixed a problem on Windows

This commit is contained in:
Fabien Potencier 2010-09-20 11:01:19 +02:00
parent ec066a0843
commit e093387179

View File

@ -48,9 +48,9 @@ class ExcludeDirectoryFilterIterator extends \FilterIterator
$inner = $inner->getInnerIterator(); $inner = $inner->getInnerIterator();
} }
$method = $inner->current()->isDir() ? 'getSubPathname' : 'getSubPath';
foreach ($this->patterns as $pattern) { foreach ($this->patterns as $pattern) {
$method = $inner->current()->isDir() ? 'getSubPathname' : 'getSubPath'; if (preg_match($pattern, strtr($this->getInnerIterator()->$method(), '\\', '/'))) {
if (preg_match($pattern, $this->getInnerIterator()->$method())) {
return false; return false;
} }
} }