Skip to content

Commit db65354

Browse files
Merge branch '2.3' into 2.7
* 2.3: [Translation] Fix the string casting in the XliffFileLoader Conflicts: src/Symfony/Component/Translation/Loader/XliffFileLoader.php
2 parents 02f9463 + ef0c287 commit db65354

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Loader/XliffFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function load($resource, $locale, $domain = 'messages')
5555
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
5656
// If the xlf file has another encoding specified, try to convert it because
5757
// simple_xml will always return utf-8 encoded values
58-
$target = $this->utf8ToCharset((string) isset($translation->target) ? $translation->target : $source, $encoding);
58+
$target = $this->utf8ToCharset((string) (isset($translation->target) ? $translation->target : $source), $encoding);
5959

6060
$catalogue->set((string) $source, $target, $domain);
6161

Tests/Loader/XliffFileLoaderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function testLoad()
2525
$this->assertEquals('en', $catalogue->getLocale());
2626
$this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
2727
$this->assertSame(array(), libxml_get_errors());
28+
$this->assertContainsOnly('string', $catalogue->all('domain1'));
2829
}
2930

3031
public function testLoadWithInternalErrorsEnabled()

0 commit comments

Comments
 (0)