[Finder] fixed ugly code

This commit is contained in:
Fabien Potencier 2010-04-21 11:16:57 +02:00
parent a21004a886
commit 6060d015eb

View File

@ -50,7 +50,7 @@ class LimitDepthFilterIterator extends \FilterIterator
{ {
$fileinfo = $this->getInnerIterator()->current(); $fileinfo = $this->getInnerIterator()->current();
$depth = substr_count(str_replace('\\', '/', $fileinfo->getPath()), '/') - substr_count(str_replace('\\', '/', $this->baseDir->getPathname()), '/'); $depth = substr_count($fileinfo->getPath(), DIRECTORY_SEPARATOR) - substr_count($this->baseDir->getPathname(), DIRECTORY_SEPARATOR);
if ($depth > $this->maxDepth) if ($depth > $this->maxDepth)
{ {