소스 검색

[Finder] fixed ugly code

Fabien Potencier 15 년 전
부모
커밋
6060d015eb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Symfony/Components/Finder/Iterator/LimitDepthFilterIterator.php

+ 1 - 1
src/Symfony/Components/Finder/Iterator/LimitDepthFilterIterator.php

@@ -50,7 +50,7 @@ class LimitDepthFilterIterator extends \FilterIterator
   {
     $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)
     {