File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -458,16 +458,20 @@ public function validateSchema(\DOMDocument $dom)
458
458
$ imports = '' ;
459
459
foreach ($ schemaLocations as $ namespace => $ location ) {
460
460
$ parts = explode ('/ ' , $ location );
461
+ $ locationstart = 'file:/// ' ;
461
462
if (0 === stripos ($ location , 'phar:// ' )) {
462
463
$ tmpfile = tempnam (sys_get_temp_dir (), 'sf2 ' );
463
464
if ($ tmpfile ) {
464
465
copy ($ location , $ tmpfile );
465
466
$ tmpfiles [] = $ tmpfile ;
466
467
$ parts = explode ('/ ' , str_replace ('\\' , '/ ' , $ tmpfile ));
468
+ } else {
469
+ array_shift ($ parts );
470
+ $ locationstart = 'phar:/// ' ;
467
471
}
468
472
}
469
473
$ drive = '\\' === DIRECTORY_SEPARATOR ? array_shift ($ parts ).'/ ' : '' ;
470
- $ location = ' file:/// ' .$ drive .implode ('/ ' , array_map ('rawurlencode ' , $ parts ));
474
+ $ location = $ locationstart .$ drive .implode ('/ ' , array_map ('rawurlencode ' , $ parts ));
471
475
472
476
$ imports .= sprintf (' <xsd:import namespace="%s" schemaLocation="%s" /> ' ."\n" , $ namespace , $ location );
473
477
}
You can’t perform that action at this time.
0 commit comments