8000 Problem in phar see mergerequest #25579 · symfony/dependency-injection@ec76727 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec76727

Browse files
Boris Betzholzfabpot
Boris Betzholz
authored andcommitted
Problem in phar see mergerequest #25579
1 parent 1dd3a41 commit ec76727

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Loader/XmlFileLoader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,20 @@ public function validateSchema(\DOMDocument $dom)
458458
$imports = '';
459459
foreach ($schemaLocations as $namespace => $location) {
460460
$parts = explode('/', $location);
461+
$locationstart = 'file:///';
461462
if (0 === stripos($location, 'phar://')) {
462463
$tmpfile = tempnam(sys_get_temp_dir(), 'sf2');
463464
if ($tmpfile) {
464465
copy($location, $tmpfile);
465466
$tmpfiles[] = $tmpfile;
466467
$parts = explode('/', str_replace('\\', '/', $tmpfile));
468+
} else {
469+
array_shift($parts);
470+
$locationstart = 'phar:///';
467471
}
468472
}
469473
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
470-
$location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
474+
$location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
471475

472476
$imports .= sprintf(' <xsd:import namespace="%s" schemaLocation="%s" />'."\n", $namespace, $location);
473477
}

0 commit comments

Comments
 (0)
0