Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 280a024

Browse filesBrowse files
[DI] dump OS-indepent paths in the compiled container
1 parent afd4027 commit 280a024
Copy full SHA for 280a024

File tree

1 file changed

+9
-1
lines changed
Filter options

1 file changed

+9
-1
lines changed

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,15 @@ private function export($value)
20172017
$suffix = $matches[0][1] + \strlen($matches[0][0]);
20182018
$matches[0][1] += \strlen($matches[1][0]);
20192019
$prefix = $matches[0][1] ? $this->doExport(substr($value, 0, $matches[0][1]), true).'.' : '';
2020-
$suffix = isset($value[$suffix]) ? '.'.$this->doExport(substr($value, $suffix), true) : '';
2020+
2021+
if ('\\' === \DIRECTORY_SEPARATOR && isset($value[$suffix])) {
2022+
$cookie = '\\'.random_int(100000, \PHP_INT_MAX);
2023+
$suffix = '.'.$this->doExport(str_replace('\\', $cookie, substr($value, $suffix)), true);
2024+
$suffix = str_replace('\\'.$cookie, "'.\\DIRECTORY_SEPARATOR.'", $suffix);
2025+
} else {
2026+
$suffix = isset($value[$suffix]) ? '.'.$this->doExport(substr($value, $suffix), true) : '';
2027+
}
2028+
20212029
$dirname = $this->asFiles ? '$this->containerDir' : '__DIR__';
20222030
$offset = 2 + $this->targetDirMaxMatches - \count($matches);
20232031

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.