Skip to content

Commit 90cb5ca

Browse files
committed
Merge branch '2.8' into 3.3
* 2.8: 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 96be707 + 72235c1 commit 90cb5ca

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
@@ -221,16 +221,20 @@ private function fixXmlLocation($schemaSource, $xmlUri)
221221
{
222222
$newPath = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd';
223223
$parts = explode('/', $newPath);
224+
$locationstart = 'file:///';
224225
if (0 === stripos($newPath, 'phar://')) {
225226
$tmpfile = tempnam(sys_get_temp_dir(), 'sf2');
226227
if ($tmpfile) {
227228
copy($newPath, $tmpfile);
228229
$parts = explode('/', str_replace('\\', '/', $tmpfile));
230+
} else {
231+
array_shift($parts);
232+
$locationstart = 'phar:///';
229233
}
230234
}
231235

232236
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
233-
$newPath = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
237+
$newPath = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
234238

235239
return str_replace($xmlUri, $newPath, $schemaSource);
236240
}

0 commit comments

Comments
 (0)