
Description
To recreate the problem just install symfony demo in windows and browse it. The problem happens because windows use a different directory separator than linux. Github escapes the windows directory separator so instead of it i will use the symbol " | " in the following sentences.
Original function uses the following code
$pathParts = explode('/src/', $absolutePath);
To fix it you could use
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$pathParts = explode('||src||', $absolutePath);
$relativePath = 'src||' . $pathParts[1];
} else {
$pathParts = explode('/src/', $absolutePath);
$relativePath = 'src/' . $pathParts[1];
}
or
if (DIRECTORY_SEPARATOR == '/') {
$pathParts = explode('/src/', $absolutePath);
$relativePath = 'src/' . $pathParts[1];
} else if (DIRECTORY_SEPARATOR == '||') {
$pathParts = explode('||src||', $absolutePath);
$relativePath = 'src||' . $pathParts[1];
}