Skip to content

Commit 41f53b3

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: fix the Composer API being used [Debug] Always decorate existing exception handlers to deal with fatal errors Enableable ArrayNodeDefinition is disabled for empty configuration Fixing a bug where the dump() function depended on bundle ordering Add nn (Norwegian Nynorsk) translation files, and improve existing file Problem in phar see mergerequest #25579 [Form] Disallow transform dates beyond the year 9999 Copied NO language files to the new NB locale. [Console] Improve phpdoc on StyleInterface::ask()
2 parents 954ff7c + b3f4b35 commit 41f53b3

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
@@ -481,16 +481,20 @@ public function validateSchema(\DOMDocument $dom)
481481
$imports = '';
482482
foreach ($schemaLocations as $namespace => $location) {
483483
$parts = explode('/', $location);
484+
$locationstart = 'file:///';
484485
if (0 === stripos($location, 'phar://')) {
485486
$tmpfile = tempnam(sys_get_temp_dir(), 'sf2');
486487
if ($tmpfile) {
487488
copy($location, $tmpfile);
488489
$tmpfiles[] = $tmpfile;
489490
$parts = explode('/', str_replace('\\', '/', $tmpfile));
491+
} else {
492+
array_shift($parts);
493+
$locationstart = 'phar:///';
490494
}
491495
}
492496
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
493-
$location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
497+
$location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
494498

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

0 commit comments

Comments
 (0)