Skip to content

Commit 72235c1

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 a1623f9 + bf521bf commit 72235c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Loader/XliffFileLoader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,19 @@ private function fixXmlLocation($schemaSource, $xmlUri)
216216
{
217217
$newPath = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd';
218218
$parts = explode('/', $newPath);
219+
$locationstart = 'file:///';
219220
if (0 === stripos($newPath, 'phar://')) {
220221
$tmpfile = tempnam(sys_get_temp_dir(), 'sf2');
221222
if ($tmpfile) {
222223
copy($newPath, $tmpfile);
223224
$parts = explode('/', str_replace('\\', '/', $tmpfile));
225+
} else {
226+
array_shift($parts);
227+
$locationstart = 'phar:///';
224228
}
225229
}
226230
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
227-
$newPath = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
231+
$newPath = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
228232

229233
return str_replace($xmlUri, $newPath, $schemaSource);
230234
}

0 commit comments

Comments
 (0)