Skip to content

Commit d3f456d

Browse files
committed
bug symfony#25 Use DIRECTORY_SEPARATOR constant to avoid Windows issues (javiereguiluz)
This PR was squashed before being merged into the master branch (closes symfony#25). Discussion ---------- Use DIRECTORY_SEPARATOR constant to avoid Windows issues This PR fixes the issue reported at symfony#14239 Commits ------- 622a9d0 Use DIRECTORY_SEPARATOR constant to avoid Windows issues
2 parents f0b76fd + 622a9d0 commit d3f456d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AppBundle/Twig/SourceCodeExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ private function getControllerRelativePath()
8282
$class = new \ReflectionClass($className);
8383

8484
$absolutePath = $class->getFilename();
85-
$pathParts = explode('/src/', $absolutePath);
86-
$relativePath = 'src/'.$pathParts[1];
85+
$pathParts = explode(DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, $absolutePath);
86+
$relativePath = 'src'.DIRECTORY_SEPARATOR.$pathParts[1];
8787

8888
return $relativePath;
8989
}

0 commit comments

Comments
 (0)